Skip to content

Commit

Permalink
PLATUI-3359 roll in timeout changes and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyFothergill committed Dec 12, 2024
1 parent 55c3b10 commit a1e1193
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [6.43.0] - 2024-12-12

### Changed

- Changes to `timeout-dialog` tests to reduce discrepancies between hardware when timing out actions

## [6.42.0] - 2024-11-28

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/browser-tests/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ beforeEach(async () => {
expect.extend({
async toShowTimeoutDialog(page) {
try {
await page.waitForSelector('#hmrc-timeout-dialog', { timeout: 500 });
await page.waitForSelector('#hmrc-timeout-dialog', { timeout: 1000 });
return {
message: () => 'expected page not to show timeout dialog',
pass: true,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hmrc-frontend",
"version": "6.42.0",
"version": "6.43.0",
"description": "Design patterns for HMRC frontends",
"scripts": {
"start": "gulp dev",
Expand Down
22 changes: 11 additions & 11 deletions src/components/timeout-dialog/timeout-dialog.browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('/components/timeout-dialog', () => {
req.url().endsWith('?keepalive')
&& req.method() === 'GET'
&& req.resourceType() === 'xhr'
), { timeout: 500 });
), { timeout: 1000 });
await expect(page).toClick('button', { text: 'Stay signed in' });
await expect(keepAliveRequest).resolves.toBeDefined();
await expect(page).not.toShowTimeoutDialog();
Expand All @@ -76,7 +76,7 @@ describe('/components/timeout-dialog', () => {
data-sign-out-url="/timeout-reached"
`);
await clockTickSeconds(page, 900);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});

Expand Down Expand Up @@ -121,7 +121,7 @@ describe('/components/timeout-dialog', () => {
await clockTickSeconds(page, 800);
await expect(page).toClick('button', { text: 'Stay signed in' });
await clockTickSeconds(page, 900);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});

Expand All @@ -140,7 +140,7 @@ describe('/components/timeout-dialog', () => {
await delay(500);
await expect(page.url()).not.toMatch('/timeout-reached');
await clockTickSeconds(page, 900);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});

Expand All @@ -153,7 +153,7 @@ describe('/components/timeout-dialog', () => {
`);
await clockTickSeconds(page, 800);
await expect(page).toClick('a', { text: 'Sign out' });
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});

Expand All @@ -166,7 +166,7 @@ describe('/components/timeout-dialog', () => {
data-sign-out-url="/signed-out-early"
`);
await clockTickSeconds(page, 900);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
await renderTimeoutDialog(page, `
data-timeout="900"
Expand All @@ -177,7 +177,7 @@ describe('/components/timeout-dialog', () => {
`);
await clockTickSeconds(page, 800);
await expect(page).toClick('a', { text: 'Sign out' });
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/signed-out-early');
});

Expand All @@ -204,7 +204,7 @@ describe('/components/timeout-dialog', () => {
document.getElementById('hmrc-timeout-sign-out-link').click();
window.clock.tick(1000); // to reach timeout while sign out page is still loading
});
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/signed-out-early');
});

Expand Down Expand Up @@ -254,7 +254,7 @@ describe('/components/timeout-dialog', () => {
]);

await clockTickSeconds(page, 1);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});

Expand Down Expand Up @@ -291,7 +291,7 @@ describe('/components/timeout-dialog', () => {
);

await clockTickSeconds(page, 1);
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page.url()).toMatch('/timeout-reached');
});
});
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('/components/timeout-dialog', () => {
expect(visibleMessage).toBe('For your security, we will sign you out in 0 seconds.');
expect(audibleMessage).toBe('For your security, we will sign you out in 20 seconds.');
completeSlowTimeoutRequest();
await page.waitForNavigation({ timeout: 500 });
await page.waitForNavigation({ timeout: 1000 });
await expect(page).toMatchTextContent('timeout page reached');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('multiple tabs open with synchronise tabs feature switch enabled', () =

await expect(foregroundPage).toClick('button', { text: 'Stay signed in' });

await expect(backgroundPage).not.toMatchTextContent('about to be signed out');
await expect(backgroundPage).not.toMatchTextContent('about to be signed out', { timeout: 5000 });

await session.close();
});
Expand All @@ -32,7 +32,7 @@ describe('multiple tabs open with synchronise tabs feature switch enabled', () =
const foregroundPage = await session.newPage();
await foregroundPage.goto(examplePreview('page-heading/default'));

await expect(backgroundPage).not.toMatchTextContent('about to be signed out');
await expect(backgroundPage).not.toMatchTextContent('about to be signed out', { timeout: 5000 });

await session.close();
});
Expand All @@ -47,7 +47,7 @@ describe('multiple tabs open with synchronise tabs feature switch enabled', () =
const foregroundPage = await session.newPage();
await foregroundPage.goto(examplePreview('timeout-dialog/synchronise-tabs'));

await expect(backgroundPageWithUnsyncedWarnings).toMatchTextContent('about to be signed out');
await expect(backgroundPageWithUnsyncedWarnings).toMatchTextContent('about to be signed out', { timeout: 5000 });

await session.close();
});
Expand Down

0 comments on commit a1e1193

Please sign in to comment.