From 4c9e5b517a539ec5fe27c656d559a1b12b12396b Mon Sep 17 00:00:00 2001 From: TimothyFothergill <67912934+TimothyFothergill@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:37:25 +0000 Subject: [PATCH] PLATUI-3359 drop overlapping checks --- .../timeout-dialog.browser.test.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/timeout-dialog/timeout-dialog.browser.test.js b/src/components/timeout-dialog/timeout-dialog.browser.test.js index eab74fdf..bae9a43a 100644 --- a/src/components/timeout-dialog/timeout-dialog.browser.test.js +++ b/src/components/timeout-dialog/timeout-dialog.browser.test.js @@ -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, ` @@ -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 });