Skip to content

Commit d9f44ce

Browse files
committed
fix test
1 parent 0e85a3d commit d9f44ce

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/snaps-rpc-methods/src/permitted/scheduleBackgroundEvent.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('snap_scheduleBackgroundEvent', () => {
104104
id: 1,
105105
method: 'snap_scheduleBackgroundEvent',
106106
params: {
107-
date: '2022-01-01T01:00:35Z',
107+
date: '2022-01-01T01:00:35+02:00',
108108
request: {
109109
method: 'handleExport',
110110
params: ['p1'],
@@ -113,7 +113,7 @@ describe('snap_scheduleBackgroundEvent', () => {
113113
});
114114

115115
expect(scheduleBackgroundEvent).toHaveBeenCalledWith({
116-
date: '2021-12-31T20:00:00.000-05:00',
116+
date: '2021-12-31T18:00-05:00',
117117
request: {
118118
method: 'handleExport',
119119
params: ['p1'],

packages/snaps-rpc-methods/src/permitted/scheduleBackgroundEvent.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ async function getScheduleBackgroundEventImplementation(
114114
const { date, request } = validatedParams;
115115

116116
// make sure any second/millisecond precision is removed.
117-
const truncatedDate = DateTime.fromISO(date)
118-
.startOf('minute')
119-
.toISO() as string;
117+
const truncatedDate = DateTime.fromISO(date).startOf('minute').toISO({
118+
suppressMilliseconds: true,
119+
suppressSeconds: true,
120+
}) as string;
120121

121122
const id = scheduleBackgroundEvent({ date: truncatedDate, request });
122123
res.result = id;

0 commit comments

Comments
 (0)