Skip to content

Commit b5b98f1

Browse files
test(mosaic): avoid Promise.withResolvers in email verification test
1 parent 8241a6c commit b5b98f1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/mosaic/src/features/user-profile/user-profile-email-section/__tests__/user-profile-add-email.controller.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ describe('useUserProfileAddEmailController', () => {
194194

195195
it('verifies an existing email without creating one, opening once its code is sent', async () => {
196196
const onCreate = vi.fn(created);
197-
const sent = Promise.withResolvers<void>();
198-
const email = verifier(() => ({ method: 'code', sent: sent.promise }));
197+
const sent = createDeferredPromise();
198+
const email = verifier(() => ({ method: 'code', sent: sent.promise.then(() => undefined) }));
199199
const { result } = renderHook(() =>
200200
useUserProfileAddEmailController({ reverification: idleReverification, onCreate }),
201201
);

0 commit comments

Comments
 (0)