Skip to content

Commit

Permalink
fix: new ahjo mode is not on in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Aug 8, 2024
1 parent 381d7ba commit faf3c75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ const url = getFrontendUrl(`/`);

fixture('Ahjo decision proposal for application')
.page(url)
.clientScripts({
content: 'window.localStorage.setItem("newAhjoMode", "1");',
})
.beforeEach(async (t) => {
clearDataToPrintOnFailure(t);
await t.useRole(handlerUserAhjo);
await t.navigateTo('/');
await ClientFunction(() =>
window.localStorage.setItem('newAhjoMode', '1')
)();
});

test('Check for handling validation errors', async (t: TestController) => {
await ClientFunction(() => window.localStorage.setItem('newAhjoMode', '1'))();
await t.navigateTo('/');
const mainIngress = new MainIngress(fi.mainIngress.heading, 'h1');
await mainIngress.isLoaded();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { ClientFunction, Role } from 'testcafe';
import { ClientFunction, Role, Selector } from 'testcafe';

import { getFrontendUrl } from './url.utils';

const handlerUserAhjo = Role(getFrontendUrl('/'), async (t: TestController) => {
// eslint-disable-next-line scanjs-rules/property_localStorage, scanjs-rules/identifier_localStorage
await ClientFunction(() => window.localStorage.setItem('newAhjoMode', '1'))();
await t.click('[data-testid="main-login-button"]');
const loginButton = Selector('[data-testid="main-login-button"]');
await t.expect(loginButton.visible).ok();
await t.click(loginButton);
});

export default handlerUserAhjo;

0 comments on commit faf3c75

Please sign in to comment.