From b13c0fc6cc072dd1ce581b4d4dcfc2da773f4e62 Mon Sep 17 00:00:00 2001 From: John Weisz Date: Tue, 17 Dec 2024 12:32:55 -0500 Subject: [PATCH 1/9] button toggle --- src/SPConfig.js | 2 ++ src/cli/index.js | 12 +++++++++ src/routes/handlers.js | 22 ++++++++++++++++ views/login_selection.ejs | 54 ++++++++++++++++++++++----------------- 4 files changed, 66 insertions(+), 24 deletions(-) diff --git a/src/SPConfig.js b/src/SPConfig.js index 281487c16..13972b909 100644 --- a/src/SPConfig.js +++ b/src/SPConfig.js @@ -39,6 +39,8 @@ export default class SPConfig { this.failureFlash = true; this.category = argv.category || "id_me"; this.signupLinkEnabled = argv.spIdpSignupLinkEnabled; + this.dsLogonEnabled = argv.dsLogonEnabled ?? true; + this.mhvLogonEnabled = argv.mhvLogonEnabled ?? true; } getMetadataParams(req) { diff --git a/src/cli/index.js b/src/cli/index.js index a18ba0caf..fa0b7ee9c 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -518,6 +518,18 @@ export function processArgs() { boolean: true, default: false, }, + dsLogonEnabled: { + description: "Enables DS Logon signin option, enabled by default", + required: false, + boolean: true, + default: true, + }, + mhvLogonEnabled: { + description: "Enables MHV Logon signin option, enabled by default", + required: false, + boolean: true, + default: true, + }, }, }) .example( diff --git a/src/routes/handlers.js b/src/routes/handlers.js index 10daf6393..ba1ab0e8f 100644 --- a/src/routes/handlers.js +++ b/src/routes/handlers.js @@ -123,6 +123,8 @@ export const samlLogin = function (template) { }); }, Promise.resolve({})) .then((authOptions) => { + authOptions.mhv_logon_enabled = isMhvLogonEnabled(req); + authOptions.ds_logon_enabled = isDsLogonEnabled(req); authOptions.body = template; authOptions.login_gov_enabled = login_gov_enabled; authOptions.login_gov_signup_link_enabled = @@ -199,3 +201,23 @@ function enabled_logingov(req) { } return false; } + +/** + * Is MHV enabled? + * + * @param {*} req service provider request + * @returns {*} boolean + */ +function isMhvLogonEnabled(req) { + return !!req.sps.options.id_me.mhvLogonEnabled; +} + +/** + * Is DS Logon enabled? + * + * @param {*} req service provider request + * @returns {*} boolean + */ +function isDsLogonEnabled(req) { + return !!req.sps.options.id_me.dsLogonEnabled; +} diff --git a/views/login_selection.ejs b/views/login_selection.ejs index 4c6b544b1..e31832f9c 100644 --- a/views/login_selection.ejs +++ b/views/login_selection.ejs @@ -80,30 +80,36 @@ Learn more about creating a Login.gov or ID.me account -

Other ways to verify

-

- My HealtheVet - - Available through January 31, 2025 - -

-

- You’ll still be able to use My HealtheVet after this date. - You’ll just need to verify yourself with Login.gov or ID.me. -

- - My HealtheVet - -

- DS Logon - - Available through September 30, 2025 - -

-

- You’ll still be able to use DS Logon for Defense Department websites after this date. -

- DS Logon + <% if (ds_logon_enabled || mhv_logon_enabled) { %> +

Other ways to verify

+ <% } %> + <% if (mhv_logon_enabled) { %> +

+ My HealtheVet + + Available through January 31, 2025 + +

+

+ You’ll still be able to use My HealtheVet after this date. + You’ll just need to verify yourself with Login.gov or ID.me. +

+ + My HealtheVet + + <% } %> + <% if (ds_logon_enabled) { %> +

+ DS Logon + + Available through September 30, 2025 + +

+

+ You’ll still be able to use DS Logon for Defense Department websites after this date. +

+ DS Logon + <% } %> From 54b351d7543bb14e863aa935ae818c516f80808d Mon Sep 17 00:00:00 2001 From: John Weisz Date: Tue, 17 Dec 2024 16:13:29 -0500 Subject: [PATCH 2/9] ui test --- src/Template.test.js | 31 +++++++++++++++++++++++++++++++ src/cli/index.js | 2 +- src/routes/handlers.js | 34 +++++++--------------------------- src/routes/handlers.test.ts | 14 ++++++++++++++ 4 files changed, 53 insertions(+), 28 deletions(-) create mode 100644 src/Template.test.js diff --git a/src/Template.test.js b/src/Template.test.js new file mode 100644 index 000000000..16990a70a --- /dev/null +++ b/src/Template.test.js @@ -0,0 +1,31 @@ +import { renderFile } from "ejs"; +import { join } from "path"; + +describe("button configuration renders correctly", () => { + const templatePath = join(__dirname, "..", "views", "login_selection.ejs"); + + test("does not render element", async () => { + const html = await renderFile(templatePath, { + login_gov_enabled: false, + mhv_logon_enabled: false, + ds_logon_enabled: false, + id_me_login_link: "something", + }); + expect(html).not.toMatch(/DS Logon/); + expect(html).not.toMatch(/My HealtheVet/); + }); + + test("does render element", async () => { + const html = await renderFile(templatePath, { + login_gov_enabled: true, + mhv_logon_enabled: true, + ds_logon_enabled: true, + id_me_login_link: "something", + mhv_login_link: "something", + dslogon_login_link: "something", + login_gov_login_link: "something", + }); + expect(html).toMatch(/DS Logon/); + expect(html).toMatch(/My HealtheVet/); + }); +}); diff --git a/src/cli/index.js b/src/cli/index.js index fa0b7ee9c..3038ebb01 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -525,7 +525,7 @@ export function processArgs() { default: true, }, mhvLogonEnabled: { - description: "Enables MHV Logon signin option, enabled by default", + description: "Enables MHV signin option, enabled by default", required: false, boolean: true, default: true, diff --git a/src/routes/handlers.js b/src/routes/handlers.js index ba1ab0e8f..969fc5e8f 100644 --- a/src/routes/handlers.js +++ b/src/routes/handlers.js @@ -122,14 +122,14 @@ export const samlLogin = function (template) { }); }); }, Promise.resolve({})) - .then((authOptions) => { - authOptions.mhv_logon_enabled = isMhvLogonEnabled(req); - authOptions.ds_logon_enabled = isDsLogonEnabled(req); - authOptions.body = template; - authOptions.login_gov_enabled = login_gov_enabled; - authOptions.login_gov_signup_link_enabled = + .then((loginViewModel) => { + loginViewModel.mhv_logon_enabled = !!req.sps?.options?.id_me?.mhvLogonEnabled; + loginViewModel.ds_logon_enabled = !!req.sps?.options?.id_me?.dsLogonEnabled; + loginViewModel.body = template; + loginViewModel.login_gov_enabled = login_gov_enabled; + loginViewModel.login_gov_signup_link_enabled = login_gov_enabled && req.sps.options.logingov.signupLinkEnabled; - res.render("layout", authOptions); + res.render("layout", loginViewModel); logger.info("User arrived from Okta. Rendering IDP login template.", { action: "parseSamlRequest", result: "success", @@ -201,23 +201,3 @@ function enabled_logingov(req) { } return false; } - -/** - * Is MHV enabled? - * - * @param {*} req service provider request - * @returns {*} boolean - */ -function isMhvLogonEnabled(req) { - return !!req.sps.options.id_me.mhvLogonEnabled; -} - -/** - * Is DS Logon enabled? - * - * @param {*} req service provider request - * @returns {*} boolean - */ -function isDsLogonEnabled(req) { - return !!req.sps.options.id_me.dsLogonEnabled; -} diff --git a/src/routes/handlers.test.ts b/src/routes/handlers.test.ts index 97e07f49c..904b33aaf 100644 --- a/src/routes/handlers.test.ts +++ b/src/routes/handlers.test.ts @@ -112,6 +112,8 @@ describe("samlLogin", () => { const spOptionsJustIdMe = { id_me: { + dsLogonEnabled: true, + mhvLogonEnabled: true, idpLoginLink: "https://api.idmelabs.com/saml/SingleSignOnService?SAMLRequest=fVJNTwIxED37Lza9s13BaGxYAoGYkOBHQD14G8sITfqxdmYR%2F73dZSEc1GQP3c57M%2B%2B96ZDA2UpNat76JX7WSJztnfWk2kIp6uhVADKkPDgkxVqtJvcL1c8LVcXAQQcrzij%2FM4AII5vgRTaflWI8ns%2FG43QmqnHuicFzKfpFv%2BgVt71i8Hx5ra7Sd%2FsmsovJkTsNnmqHcYVxZzS%2BLBel2DJXSkobNNhtIFY3RVHI1kMM%2B29JVfsjiYK4mCWXxkPT68CkRIXK5Gbt0MI75Tq4A35l%2FMbiymz8o%2B%2FmiewVI7XcZElkdyFqbAMsBccaxWjYUFVrKo5OGvIdbMIuX%2BNuKM8Bw8MKHlJY89lTsEZ%2FNz0d8P9ZNjdm3ftooapqNBGjZ5FNrA1f04jA2EmSxyndjnHdCk5JMu45mwZXQTTUeMI9aD56OEdNbdreEj9GXdYpLPCwQZdm5smZ9CQToo7gNaZNgBx0Rn%2Ftcqj9oehUPX%2BYox8%3D&RelayState=%2F&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=crqsP27LiAeJpKx7%2Bjshr4OeqHvFnp1rYmkP4rHTYXdEIjp6iIo7Zu3uwzXfkm%2BJp0ShXPAy7R6855y1dMBmOz3eVjdvdm8rQ7%2B044hTw3Cxmcuf836up4rsKLeT4vIHc3%2FA3qtDK3ut%2FXiArNLZJ%2FwOrC6KNWAuhJQ8fZIPv18uiCw1eNBJA2iCUD6KKtI%2FDgwA%2B1MtpRCsHNcpX23XQryIPkH8l6MsRDw1ZM3vttF7UZa6OkIsxFEXFJ4VZMal%2BciNZV%2FiB0%2FK3QvmbbKX8k%2BuJKL8rmIJr0XhNw%2BYLcMTNnpL%2FTQloi0xS18gu3J6GY%2BTEsG1CeJRNHkuJyF3LQ%3D%3D", getResponseParams: () => { @@ -135,6 +137,8 @@ describe("samlLogin", () => { const spOptionsJustwithLoginGov = { id_me: { + dsLogonEnabled: true, + mhvLogonEnabled: true, idpLoginLink: "https://api.idmelabs.com/saml/SingleSignOnService?SAMLRequest=fVJNTwIxED37Lza9s13BaGxYAoGYkOBHQD14G8sITfqxdmYR%2F73dZSEc1GQP3c57M%2B%2B96ZDA2UpNat76JX7WSJztnfWk2kIp6uhVADKkPDgkxVqtJvcL1c8LVcXAQQcrzij%2FM4AII5vgRTaflWI8ns%2FG43QmqnHuicFzKfpFv%2BgVt71i8Hx5ra7Sd%2FsmsovJkTsNnmqHcYVxZzS%2BLBel2DJXSkobNNhtIFY3RVHI1kMM%2B29JVfsjiYK4mCWXxkPT68CkRIXK5Gbt0MI75Tq4A35l%2FMbiymz8o%2B%2FmiewVI7XcZElkdyFqbAMsBccaxWjYUFVrKo5OGvIdbMIuX%2BNuKM8Bw8MKHlJY89lTsEZ%2FNz0d8P9ZNjdm3ftooapqNBGjZ5FNrA1f04jA2EmSxyndjnHdCk5JMu45mwZXQTTUeMI9aD56OEdNbdreEj9GXdYpLPCwQZdm5smZ9CQToo7gNaZNgBx0Rn%2Ftcqj9oehUPX%2BYox8%3D&RelayState=%2F&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=crqsP27LiAeJpKx7%2Bjshr4OeqHvFnp1rYmkP4rHTYXdEIjp6iIo7Zu3uwzXfkm%2BJp0ShXPAy7R6855y1dMBmOz3eVjdvdm8rQ7%2B044hTw3Cxmcuf836up4rsKLeT4vIHc3%2FA3qtDK3ut%2FXiArNLZJ%2FwOrC6KNWAuhJQ8fZIPv18uiCw1eNBJA2iCUD6KKtI%2FDgwA%2B1MtpRCsHNcpX23XQryIPkH8l6MsRDw1ZM3vttF7UZa6OkIsxFEXFJ4VZMal%2BciNZV%2FiB0%2FK3QvmbbKX8k%2BuJKL8rmIJr0XhNw%2BYLcMTNnpL%2FTQloi0xS18gu3J6GY%2BTEsG1CeJRNHkuJyF3LQ%3D%3D", getResponseParams: () => { @@ -155,6 +159,8 @@ describe("samlLogin", () => { }, }, logingov: { + dsLogonEnabled: true, + mhvLogonEnabled: true, idpLoginLink: "https://idp.int.identitysandbox.gov/api/saml/metadata2021?SAMLRequest=fVJNTwIxED37Lza9s13BaGxYAoGYkOBHQD14G8sITfqxdmYR%2F73dZSEc1GQP3c57M%2B%2B96ZDA2UpNat76JX7WSJztnfWk2kIp6uhVADKkPDgkxVqtJvcL1c8LVcXAQQcrzij%2FM4AII5vgRTaflWI8ns%2FG43QmqnHuicFzKfpFv%2BgVt71i8Hx5ra7Sd%2FsmsovJkTsNnmqHcYVxZzS%2BLBel2DJXSkobNNhtIFY3RVHI1kMM%2B29JVfsjiYK4mCWXxkPT68CkRIXK5Gbt0MI75Tq4A35l%2FMbiymz8o%2B%2FmiewVI7XcZElkdyFqbAMsBccaxWjYUFVrKo5OGvIdbMIuX%2BNuKM8Bw8MKHlJY89lTsEZ%2FNz0d8P9ZNjdm3ftooapqNBGjZ5FNrA1f04jA2EmSxyndjnHdCk5JMu45mwZXQTTUeMI9aD56OEdNbdreEj9GXdYpLPCwQZdm5smZ9CQToo7gNaZNgBx0Rn%2Ftcqj9oehUPX%2BYox8%3D&RelayState=%2F&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=crqsP27LiAeJpKx7%2Bjshr4OeqHvFnp1rYmkP4rHTYXdEIjp6iIo7Zu3uwzXfkm%2BJp0ShXPAy7R6855y1dMBmOz3eVjdvdm8rQ7%2B044hTw3Cxmcuf836up4rsKLeT4vIHc3%2FA3qtDK3ut%2FXiArNLZJ%2FwOrC6KNWAuhJQ8fZIPv18uiCw1eNBJA2iCUD6KKtI%2FDgwA%2B1MtpRCsHNcpX23XQryIPkH8l6MsRDw1ZM3vttF7UZa6OkIsxFEXFJ4VZMal%2BciNZV%2FiB0%2FK3QvmbbKX8k%2BuJKL8rmIJr0XhNw%2BYLcMTNnpL%2FTQloi0xS18gu3J6GY%2BTEsG1CeJRNHkuJyF3LQ%3D%3D", getResponseParams: () => { @@ -206,6 +212,8 @@ describe("samlLogin", () => { "https://identityProviderUrl.com?SAMLRequest=utrequest&RelayState=&op=signup", login_gov_enabled: false, login_gov_signup_link_enabled: false, + ds_logon_enabled: true, + mhv_logon_enabled: true, }; const expected_authoptions = { @@ -220,6 +228,8 @@ describe("samlLogin", () => { "https://identityProviderUrl.com?SAMLRequest=utrequest&RelayState=&op=signup", login_gov_enabled: false, login_gov_signup_link_enabled: false, + ds_logon_enabled: true, + mhv_logon_enabled: true, }; const expected_authoptions_failure_to_proof = { @@ -234,6 +244,8 @@ describe("samlLogin", () => { "https://identityProviderUrl.com?SAMLRequest=utrequest&RelayState=&op=signup", login_gov_enabled: false, login_gov_signup_link_enabled: false, + ds_logon_enabled: true, + mhv_logon_enabled: true, }; const expected_authoptions_login_gov_enabled = { body: "login_selection", @@ -251,6 +263,8 @@ describe("samlLogin", () => { login_gov_signup_link_enabled: true, login_gov_signup_link: "https://identityProviderUrl.com?SAMLRequest=utrequest&RelayState=", + ds_logon_enabled: true, + mhv_logon_enabled: true, }; const mockGetSamlRequestUrl = jest From 639455bf9049e199fb442e23206eaffa292a58b5 Mon Sep 17 00:00:00 2001 From: John Weisz Date: Tue, 17 Dec 2024 16:35:01 -0500 Subject: [PATCH 3/9] lint fix --- src/routes/handlers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/handlers.js b/src/routes/handlers.js index 969fc5e8f..9df129a4b 100644 --- a/src/routes/handlers.js +++ b/src/routes/handlers.js @@ -123,8 +123,10 @@ export const samlLogin = function (template) { }); }, Promise.resolve({})) .then((loginViewModel) => { - loginViewModel.mhv_logon_enabled = !!req.sps?.options?.id_me?.mhvLogonEnabled; - loginViewModel.ds_logon_enabled = !!req.sps?.options?.id_me?.dsLogonEnabled; + loginViewModel.mhv_logon_enabled = !!req.sps?.options?.id_me + ?.mhvLogonEnabled; + loginViewModel.ds_logon_enabled = !!req.sps?.options?.id_me + ?.dsLogonEnabled; loginViewModel.body = template; loginViewModel.login_gov_enabled = login_gov_enabled; loginViewModel.login_gov_signup_link_enabled = From 329b6232b6a987dacefe57df77b0417d9e35a49b Mon Sep 17 00:00:00 2001 From: John Weisz Date: Tue, 17 Dec 2024 16:38:10 -0500 Subject: [PATCH 4/9] test fix --- src/Template.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Template.test.js b/src/Template.test.js index 16990a70a..6efeaf776 100644 --- a/src/Template.test.js +++ b/src/Template.test.js @@ -13,6 +13,7 @@ describe("button configuration renders correctly", () => { }); expect(html).not.toMatch(/DS Logon/); expect(html).not.toMatch(/My HealtheVet/); + expect(html).not.toMatch(/Login.gov<\/title>/); }); test("does render element", async () => { @@ -27,5 +28,6 @@ describe("button configuration renders correctly", () => { }); expect(html).toMatch(/DS Logon/); expect(html).toMatch(/My HealtheVet/); + expect(html).toMatch(/<title>Login.gov<\/title>/); }); }); From 124cfdbe28c5cf4ca34f561245133fc748c759eb Mon Sep 17 00:00:00 2001 From: John Weisz <johnmweisz@gmail.com> Date: Tue, 17 Dec 2024 17:35:58 -0500 Subject: [PATCH 5/9] use ts --- src/{Template.test.js => Template.test.ts} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename src/{Template.test.js => Template.test.ts} (80%) diff --git a/src/Template.test.js b/src/Template.test.ts similarity index 80% rename from src/Template.test.js rename to src/Template.test.ts index 6efeaf776..0e9eea26f 100644 --- a/src/Template.test.js +++ b/src/Template.test.ts @@ -2,10 +2,15 @@ import { renderFile } from "ejs"; import { join } from "path"; describe("button configuration renders correctly", () => { - const templatePath = join(__dirname, "..", "views", "login_selection.ejs"); + const templatePath: string = join( + __dirname, + "..", + "views", + "login_selection.ejs" + ); test("does not render element", async () => { - const html = await renderFile(templatePath, { + const html: string = await renderFile(templatePath, { login_gov_enabled: false, mhv_logon_enabled: false, ds_logon_enabled: false, @@ -17,7 +22,7 @@ describe("button configuration renders correctly", () => { }); test("does render element", async () => { - const html = await renderFile(templatePath, { + const html: string = await renderFile(templatePath, { login_gov_enabled: true, mhv_logon_enabled: true, ds_logon_enabled: true, From d048fbb6f98c0c763f0a3bb5aa2389e94dc7ce4e Mon Sep 17 00:00:00 2001 From: John Weisz <johnmweisz@gmail.com> Date: Tue, 17 Dec 2024 17:46:38 -0500 Subject: [PATCH 6/9] add dev ejs --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ac86eb3fd..27f43e9a3 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "yargs": "^16.2.0" }, "devDependencies": { + "@types/ejs": "^3.1.5", "@types/express": "^4.17.11", "@types/jest": "^27.0.1", "@types/node": "^14.14.37", @@ -147,4 +148,4 @@ "jsonwebtoken": ">=9.0.0", "browserify-sign": ">=4.2.2" } -} \ No newline at end of file +} From 8dc5c7be6f68df962a74e652ba2928794fd81975 Mon Sep 17 00:00:00 2001 From: John Weisz <johnmweisz@gmail.com> Date: Tue, 17 Dec 2024 17:50:20 -0500 Subject: [PATCH 7/9] remove test --- package.json | 1 - src/Template.test.ts | 38 -------------------------------------- 2 files changed, 39 deletions(-) delete mode 100644 src/Template.test.ts diff --git a/package.json b/package.json index 27f43e9a3..85f1b2765 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,6 @@ "yargs": "^16.2.0" }, "devDependencies": { - "@types/ejs": "^3.1.5", "@types/express": "^4.17.11", "@types/jest": "^27.0.1", "@types/node": "^14.14.37", diff --git a/src/Template.test.ts b/src/Template.test.ts deleted file mode 100644 index 0e9eea26f..000000000 --- a/src/Template.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { renderFile } from "ejs"; -import { join } from "path"; - -describe("button configuration renders correctly", () => { - const templatePath: string = join( - __dirname, - "..", - "views", - "login_selection.ejs" - ); - - test("does not render element", async () => { - const html: string = await renderFile(templatePath, { - login_gov_enabled: false, - mhv_logon_enabled: false, - ds_logon_enabled: false, - id_me_login_link: "something", - }); - expect(html).not.toMatch(/DS Logon/); - expect(html).not.toMatch(/My HealtheVet/); - expect(html).not.toMatch(/<title>Login.gov<\/title>/); - }); - - test("does render element", async () => { - const html: string = await renderFile(templatePath, { - login_gov_enabled: true, - mhv_logon_enabled: true, - ds_logon_enabled: true, - id_me_login_link: "something", - mhv_login_link: "something", - dslogon_login_link: "something", - login_gov_login_link: "something", - }); - expect(html).toMatch(/DS Logon/); - expect(html).toMatch(/My HealtheVet/); - expect(html).toMatch(/<title>Login.gov<\/title>/); - }); -}); From 2e9b1fcc08faccc1201a9bb5305caca127f3b3fa Mon Sep 17 00:00:00 2001 From: John Weisz <johnmweisz@gmail.com> Date: Tue, 17 Dec 2024 17:54:34 -0500 Subject: [PATCH 8/9] test with cb --- src/Template.test.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/Template.test.js diff --git a/src/Template.test.js b/src/Template.test.js new file mode 100644 index 000000000..acfed09fa --- /dev/null +++ b/src/Template.test.js @@ -0,0 +1,43 @@ +import { renderFile } from "ejs"; +import { join } from "path"; + +describe("button configuration renders correctly", () => { + const templatePath = join(__dirname, "..", "views", "login_selection.ejs"); + + test("does not render element", async () => { + renderFile( + templatePath, + { + login_gov_enabled: false, + mhv_logon_enabled: false, + ds_logon_enabled: false, + id_me_login_link: "something", + }, + (err, html) => { + expect(html).not.toMatch(/DS Logon/); + expect(html).not.toMatch(/My HealtheVet/); + expect(html).not.toMatch(/<title>Login.gov<\/title>/); + } + ); + }); + + test("does render element", async () => { + renderFile( + templatePath, + { + login_gov_enabled: true, + mhv_logon_enabled: true, + ds_logon_enabled: true, + id_me_login_link: "something", + mhv_login_link: "something", + dslogon_login_link: "something", + login_gov_login_link: "something", + }, + (err, html) => { + expect(html).toMatch(/DS Logon/); + expect(html).toMatch(/My HealtheVet/); + expect(html).toMatch(/<title>Login.gov<\/title>/); + } + ); + }); +}); From 74518630d9de8c646f939daefe32e8cd25e5f98d Mon Sep 17 00:00:00 2001 From: John Weisz <johnmweisz@gmail.com> Date: Tue, 17 Dec 2024 18:02:54 -0500 Subject: [PATCH 9/9] other ways --- src/Template.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Template.test.js b/src/Template.test.js index acfed09fa..e7a0a4d53 100644 --- a/src/Template.test.js +++ b/src/Template.test.js @@ -17,6 +17,7 @@ describe("button configuration renders correctly", () => { expect(html).not.toMatch(/DS Logon/); expect(html).not.toMatch(/My HealtheVet/); expect(html).not.toMatch(/<title>Login.gov<\/title>/); + expect(html).not.toMatch(/Other ways to verify/); } ); }); @@ -37,6 +38,7 @@ describe("button configuration renders correctly", () => { expect(html).toMatch(/DS Logon/); expect(html).toMatch(/My HealtheVet/); expect(html).toMatch(/<title>Login.gov<\/title>/); + expect(html).toMatch(/Other ways to verify/); } ); });