Skip to content

Commit

Permalink
refactor: apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalinDe committed Feb 13, 2024
1 parent e3364c7 commit 36b99cf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions web/frontend/tests/forms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import Worker3 from './json/api/proxies/dela-worker-3.json';

initI18n();

const prettyFormStates = new Map([
[0, 'Initial'],
[1, 'Open'],
[2, 'Closed'],
[3, 'ShuffledBallots'],
[4, 'PubSharesSubmitted'],
[5, 'ResultAvailable'],
[6, 'Canceled'],
]);
const prettyFormStates = [
'Initial',
'Open',
'Closed',
'ShuffledBallots',
'PubSharesSubmitted',
'ResultAvailable',
'Canceled',
];

// main elements

Expand Down Expand Up @@ -96,15 +96,15 @@ async function assertIsOnlyVisibleInStates(
initialized?: boolean
) {
for (const i of states) {
await test.step(`Assert is visible in form state '${prettyFormStates.get(i)}'`, async () => {
await test.step(`Assert is visible in form state '${prettyFormStates.at(i)}'`, async () => {
await setUpMocks(page, i, dkgActorsStatus === undefined ? 6 : dkgActorsStatus, initialized);
await page.reload({ waitUntil: 'networkidle' });
await assert(page, locator);
});
}
for (const i of [0, 1, 2, 3, 4, 5].filter((x) => !states.includes(x))) {
await test.step(

Check failure on line 106 in web/frontend/tests/forms.spec.ts

View workflow job for this annotation

GitHub Actions / Web frontend Lint

Replace `⏎······`Assert·is·not·visible·in·form·state·'${prettyFormStates.at(i)}'`,⏎·····` with ``Assert·is·not·visible·in·form·state·'${prettyFormStates.at(i)}'`,`
`Assert is not visible in form state '${prettyFormStates.get(i)}'`,
`Assert is not visible in form state '${prettyFormStates.at(i)}'`,
async () => {
await setUpMocks(page, i, dkgActorsStatus === undefined ? 6 : dkgActorsStatus, initialized);

Check failure on line 109 in web/frontend/tests/forms.spec.ts

View workflow job for this annotation

GitHub Actions / Web frontend Lint

Delete `··`
await page.reload({ waitUntil: 'networkidle' });

Check failure on line 110 in web/frontend/tests/forms.spec.ts

View workflow job for this annotation

GitHub Actions / Web frontend Lint

Delete `··`
Expand Down

0 comments on commit 36b99cf

Please sign in to comment.