From 31bcf738983fb46d96ab15a56816542be9dd6aee Mon Sep 17 00:00:00 2001 From: Karan Preet Singh Sasan Date: Thu, 9 Nov 2023 18:57:25 -0800 Subject: [PATCH] Fixing tests --- facade-app/src/test/Header.test.tsx | 10 ++-- .../src/test/__snapshots__/App.test.tsx.snap | 58 ++++++++++++++++++- .../test/__snapshots__/Footer.test.tsx.snap | 2 +- .../test/__snapshots__/Header.test.tsx.snap | 44 ++++++++------ 4 files changed, 89 insertions(+), 25 deletions(-) diff --git a/facade-app/src/test/Header.test.tsx b/facade-app/src/test/Header.test.tsx index d6ec2d5..c4b7e2c 100644 --- a/facade-app/src/test/Header.test.tsx +++ b/facade-app/src/test/Header.test.tsx @@ -92,7 +92,7 @@ describe("Header", () => { }; render(
); - const link = screen.getAllByRole("link")[0]; + const link = screen.getAllByRole("link")[2]; const githubIcon = screen.getAllByRole("img")[2]; const text = screen.getByText("Github"); @@ -130,8 +130,8 @@ describe("Header", () => { showHints: false, }; render(
); - - const owaspLink = screen.getAllByRole("link")[1]; + + const owaspLink = screen.getByRole("link", { name: "Owasp VulnerableApp" }); const owaspIcon = screen.getAllByRole("img")[3]; const text = screen.getByText("Owasp VulnerableApp"); @@ -154,7 +154,7 @@ describe("Header", () => { }; render(
); - const zapLink = screen.getAllByRole("link")[2]; + const zapLink = screen.getByRole("link", { name: "ZAP JWT Addon" }); const zapIcon = screen.getAllByRole("img")[4]; const text = screen.getByText("ZAP JWT Addon"); @@ -177,7 +177,7 @@ describe("Header", () => { }; render(
); - const zapLink = screen.getAllByRole("link")[3]; + const zapLink = screen.getAllByRole("link")[5]; const zapIcon = screen.getAllByRole("img")[5]; const text = screen.getByText("ZAP FileUpload Addon"); diff --git a/facade-app/src/test/__snapshots__/App.test.tsx.snap b/facade-app/src/test/__snapshots__/App.test.tsx.snap index d704c2d..f6eb61b 100644 --- a/facade-app/src/test/__snapshots__/App.test.tsx.snap +++ b/facade-app/src/test/__snapshots__/App.test.tsx.snap @@ -95,6 +95,62 @@ exports[`App renders correctly 1`] = ` + @@ -2282,7 +2338,7 @@ exports[`App renders correctly 1`] = ` data-testid="FOOTER_COPYRIGHT_TEXT" > © Copyright - 2022 + 2023 , SasanLabs diff --git a/facade-app/src/test/__snapshots__/Footer.test.tsx.snap b/facade-app/src/test/__snapshots__/Footer.test.tsx.snap index 3f18e83..ceb2ffc 100644 --- a/facade-app/src/test/__snapshots__/Footer.test.tsx.snap +++ b/facade-app/src/test/__snapshots__/Footer.test.tsx.snap @@ -17,7 +17,7 @@ exports[`Footer renders correctly 1`] = ` data-testid="FOOTER_COPYRIGHT_TEXT" > © Copyright - 2022 + 2023 , SasanLabs diff --git a/facade-app/src/test/__snapshots__/Header.test.tsx.snap b/facade-app/src/test/__snapshots__/Header.test.tsx.snap index f9b1747..30e0301 100644 --- a/facade-app/src/test/__snapshots__/Header.test.tsx.snap +++ b/facade-app/src/test/__snapshots__/Header.test.tsx.snap @@ -100,28 +100,36 @@ exports[`Header renders correctly 1`] = ` class="rs-dropdown-menu" role="menu" > -
  • - - DAST - -
  • -
  • + DAST + +
  • + + - - SAST - - + + SAST + + +