-
-
Notifications
You must be signed in to change notification settings - Fork 656
/
Copy pathstorage.test.js
30 lines (24 loc) · 1.04 KB
/
storage.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { getByText } from '@testing-library/testcafe';
import AddAccountPage from './addaccount-page.po';
import { injectLS } from './clientScripts';
import { FIXTURE_LOCALSTORAGE_WITH_ONE_ACC, PAGES } from './fixtures';
import SettingsPage from './settings-page.po';
import { getTransValueByKey } from './translation-utils';
const addAccountPage = new AddAccountPage();
const settingsPage = new SettingsPage();
fixture('Storage').page(PAGES.DASHBOARD);
test('Should apply empty storage', async (t) => {
// localStorage is set after page load, so first navigation should happen
await addAccountPage.navigateTo(PAGES.DASHBOARD);
await addAccountPage.waitPageLoaded();
const title = getByText(getTransValueByKey('DECRYPT_ACCESS'));
await t.expect(title.exists).ok();
});
test.clientScripts({ content: injectLS(FIXTURE_LOCALSTORAGE_WITH_ONE_ACC) })(
'Should apply storage with one account',
async () => {
await settingsPage.navigateToPage();
await settingsPage.waitPageLoaded();
await settingsPage.expectAccountTableToMatchCount(1);
}
);