Skip to content

Commit

Permalink
adjust test to use hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisleewilcox committed Nov 7, 2024
1 parent b29c52e commit 32c1daf
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,7 @@ import { mockNotificationServices } from '../utils/mocks';
import { SmokeNotifications } from '../../../tags';

describe(SmokeNotifications('Account syncing'), () => {
it('retrieves all previously synced accounts', async () => {
const decryptedAccountNames = await Promise.all(
accountsSyncMockResponse.map(async (response) => {
const decryptedAccountName = await SDK.Encryption.decryptString(
response.Data,
NOTIFICATIONS_TEAM_STORAGE_KEY,
);
return JSON.parse(decryptedAccountName).n;
}),
);

beforeAll(async () => {
const mockServer = await startMockServer({
mockUrl: 'https://user-storage.api.cx.metamask.io/api/v1/userstorage',
});
Expand All @@ -47,6 +37,22 @@ describe(SmokeNotifications('Account syncing'), () => {
newInstance: true,
delete: true,
});
});

afterAll(async () => {
await stopMockServer();
});

it('retrieves all previously synced accounts', async () => {
const decryptedAccountNames = await Promise.all(
accountsSyncMockResponse.map(async (response) => {
const decryptedAccountName = await SDK.Encryption.decryptString(
response.Data,
NOTIFICATIONS_TEAM_STORAGE_KEY,
);
return JSON.parse(decryptedAccountName).n;
}),
);

await importWalletWithRecoveryPhrase(
NOTIFICATIONS_TEAM_SEED_PHRASE,
Expand All @@ -61,7 +67,5 @@ describe(SmokeNotifications('Account syncing'), () => {
await AccountListView.getAccountElementByAccountName(accountName),
);
}

await stopMockServer();
});
});

0 comments on commit 32c1daf

Please sign in to comment.