Skip to content

Commit

Permalink
PLATUI-3359 drop overlapping checks
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyFothergill committed Dec 11, 2024
1 parent e618de3 commit 4c9e5b5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/components/timeout-dialog/timeout-dialog.browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('/components/timeout-dialog', () => {
expect(page.url()).toMatch('/timeout-reached');
});

// function twentyTimes(value) { return Array.from({ length: 20 }, () => value); }
function twentyTimes(value) { return Array.from({ length: 19 }, () => value); }

it('should update the audible time remaining every 20 seconds', async () => {
await renderTimeoutDialog(page, `
Expand All @@ -274,24 +274,24 @@ describe('/components/timeout-dialog', () => {

await clockTickSeconds(page, 59);

await audibleCountdownFrom(page);
const audibleMessageWithMoreThanAMinuteRemaining = await audibleCountdownFrom(page);

await takeTextContentEachSecondForAMinute(page, '#hmrc-timeout-message');
const allAudibleMessagesDuringLastMinute = await takeTextContentEachSecondForAMinute(page, '#hmrc-timeout-message');

// expect(audibleMessageWithMoreThanAMinuteRemaining)
// .toBe('For your security, we will sign you out in 2 minutes.');
expect(audibleMessageWithMoreThanAMinuteRemaining)
.toBe('For your security, we will sign you out in 2 minutes.');

// expect(allAudibleMessagesDuringLastMinute.slice(0, 20)).toStrictEqual(
// twentyTimes('For your security, we will sign you out in 1 minute.'),
// );
expect(allAudibleMessagesDuringLastMinute.slice(0, 19)).toStrictEqual(
twentyTimes('For your security, we will sign you out in 1 minute.'),
);

// expect(allAudibleMessagesDuringLastMinute.slice(20, 40)).toStrictEqual(
// twentyTimes('For your security, we will sign you out in 40 seconds.'),
// );
expect(allAudibleMessagesDuringLastMinute.slice(20, 39)).toStrictEqual(
twentyTimes('For your security, we will sign you out in 40 seconds.'),
);

// expect(allAudibleMessagesDuringLastMinute.slice(40, 60)).toStrictEqual(
// twentyTimes('For your security, we will sign you out in 20 seconds.'),
// );
expect(allAudibleMessagesDuringLastMinute.slice(40, 59)).toStrictEqual(
twentyTimes('For your security, we will sign you out in 20 seconds.'),
);

await clockTickSeconds(page, 1);
await page.waitForNavigation({ timeout: 500 });
Expand Down

0 comments on commit 4c9e5b5

Please sign in to comment.