Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Preet Singh Sasan committed Nov 10, 2023
1 parent a880a74 commit 31bcf73
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 25 deletions.
10 changes: 5 additions & 5 deletions facade-app/src/test/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("Header", () => {
};
render(<Header setGlobalState={mock} globalState={state} />);

const link = screen.getAllByRole("link")[0];
const link = screen.getAllByRole("link")[2];
const githubIcon = screen.getAllByRole("img")[2];
const text = screen.getByText("Github");

Expand Down Expand Up @@ -130,8 +130,8 @@ describe("Header", () => {
showHints: false,
};
render(<Header setGlobalState={mock} globalState={state} />);

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");

Expand All @@ -154,7 +154,7 @@ describe("Header", () => {
};
render(<Header setGlobalState={mock} globalState={state} />);

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");

Expand All @@ -177,7 +177,7 @@ describe("Header", () => {
};
render(<Header setGlobalState={mock} globalState={state} />);

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");

Expand Down
58 changes: 57 additions & 1 deletion facade-app/src/test/__snapshots__/App.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,62 @@ exports[`App renders correctly 1`] = `
</span>
</a>
</li>
<li
class="rs-dropdown rs-dropdown-placement-bottom-start"
role="menu"
>
<ul
class="rs-dropdown-menu"
role="menu"
>
<a
href="../scanner/dast"
>
<li
class="rs-dropdown-item"
>
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Dynamic Application Security Testing"
>
DAST
</a>
</li>
</a>
<a
href="../scanner/sast"
>
<li
class="rs-dropdown-item"
>
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Static Application Security Testing"
>
SAST
</a>
</li>
</a>
</ul>
<a
class="rs-btn rs-btn-subtle rs-dropdown-toggle"
tabindex="0"
>
Scanners
<span
class="rs-dropdown-toggle-caret"
/>
<span
class="rs-ripple-pond"
>
<span
class="rs-ripple"
/>
</span>
</a>
</li>
<a
href="https://github.com/SasanLabs/VulnerableApp-facade"
>
Expand Down Expand Up @@ -2282,7 +2338,7 @@ exports[`App renders correctly 1`] = `
data-testid="FOOTER_COPYRIGHT_TEXT"
>
© Copyright
2022
2023
, SasanLabs
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion facade-app/src/test/__snapshots__/Footer.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`Footer renders correctly 1`] = `
data-testid="FOOTER_COPYRIGHT_TEXT"
>
© Copyright
2022
2023
, SasanLabs
</div>
</div>
Expand Down
44 changes: 26 additions & 18 deletions facade-app/src/test/__snapshots__/Header.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,36 @@ exports[`Header renders correctly 1`] = `
class="rs-dropdown-menu"
role="menu"
>
<li
class="rs-dropdown-item"
<a
href="../scanner/dast"
>
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Dynamic Application Security Testing"
<li
class="rs-dropdown-item"
>
DAST
</a>
</li>
<li
class="rs-dropdown-item"
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Dynamic Application Security Testing"
>
DAST
</a>
</li>
</a>
<a
href="../scanner/sast"
>
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Static Application Security Testing"
<li
class="rs-dropdown-item"
>
SAST
</a>
</li>
<a
class="rs-dropdown-item-content"
tabindex="-1"
title="Static Application Security Testing"
>
SAST
</a>
</li>
</a>
</ul>
<a
class="rs-btn rs-btn-subtle rs-dropdown-toggle"
Expand Down

0 comments on commit 31bcf73

Please sign in to comment.