diff --git a/app/assets/javascripts/loginAlert.js b/app/assets/javascripts/loginAlert.js index 67ed439ae..1f3281788 100644 --- a/app/assets/javascripts/loginAlert.js +++ b/app/assets/javascripts/loginAlert.js @@ -12,7 +12,7 @@ const days = Math.floor(difference / (1000 * 60 * 60 * 24)); // Visibility logic - if (days < 0) { + if (days < 0 || days > 10) { // Hide if more than 10 days away OR if already past the date document.getElementById("countdown-container").style.display = "none"; } else { diff --git a/app/templates/views/signin.html b/app/templates/views/signin.html index 398a39274..8773fba24 100644 --- a/app/templates/views/signin.html +++ b/app/templates/views/signin.html @@ -13,10 +13,11 @@ {% block maincolumn_content %}
-
+
+

Login.gov is required by April 9, 2024

- You have left to use login.gov to sign in + You have left to use Login.gov to sign in

@@ -50,17 +51,20 @@ {% endcall %}
-

Notify.gov is changing the Sign in experience to Login.gov on March x, 2024

+

Notify.gov is changing the sign-in experience to Login.gov effective
April 9, 2024

Why are we doing this?

+

What do I need to do?

+
-

Don't have a login.gov account?

-

If you don't have an account already, sign up here:

- Create Login.gov account + Create Login.gov account
diff --git a/tests/javascripts/loginAlert.test.js b/tests/javascripts/loginAlert.test.js index 4bb0d3eaa..895aa3647 100644 --- a/tests/javascripts/loginAlert.test.js +++ b/tests/javascripts/loginAlert.test.js @@ -1,11 +1,23 @@ beforeAll(() => { jest.spyOn(global, 'setTimeout'); + + document.body.innerHTML = ` +
+
+

Login.gov is required by April 9, 2024

+

+ You have left to use Login.gov to sign in +

+
+
+ ` + const sessionTimerModule = require('../../app/assets/javascripts/loginAlert.js'); window.GOVUK.modules.start(); }); jest.useFakeTimers(); -const targetDate = new Date("March 5, 2024 00:00:00"); // Reference point +const targetDate = new Date("April 9, 2024 00:00:00"); // Reference point test('Hides the countdown if more than 10 days away', () => { jest.setSystemTime(targetDate.getTime() - 12 * 24 * 60 * 60 * 1000); // 12 days before @@ -38,11 +50,3 @@ test('Hides the countdown if the target date has passed', () => { expect(document.getElementById("countdown-container").style.display).toBe("none"); }); - -test('Displays "Countdown Complete!" when the countdown finishes', () => { - jest.setSystemTime(targetDate.getTime()); - - window.updateCountdown(); - - expect(document.getElementById("countdown").textContent).toBe("Countdown Complete!"); -});