Skip to content

Commit 3e04f35

Browse files
committed
update cypress tests
1 parent 559de62 commit 3e04f35

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

cypress/integration/test.spec.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
describe("test", () => {
99
before(() => {
10-
cy.visit("/api");
10+
cy.visit("/api/recursive");
1111
});
1212

1313
it("renders query parameters", () => {
@@ -20,15 +20,25 @@ describe("test", () => {
2020
return false;
2121
});
2222

23-
function checkTab(tab: RegExp, heading: RegExp) {
23+
function checkTab(tab: RegExp, links: RegExp[], heading: RegExp) {
2424
cy.get(".navbar").findByRole("link", { name: tab }).click();
25+
26+
for (let link of links) {
27+
cy.get("nav.menu").findByRole("link", { name: link }).click();
28+
}
29+
2530
cy.findByRole("heading", { name: heading, level: 1 }).should("exist");
2631
}
2732

28-
checkTab(/issue 21/i, /missing summary/i);
29-
checkTab(/cos/i, /generating an iam token/i);
30-
checkTab(/yaml/i, /hello world/i);
31-
checkTab(/api/i, /recursive/i);
33+
checkTab(/issue 21/i, [], /missing summary/i);
34+
checkTab(/cos/i, [], /generating an iam token/i);
35+
checkTab(/yaml/i, [/api/i, /hello world/i], /hello world/i);
36+
checkTab(
37+
/petstore/i,
38+
[/pet/i, /add a new pet to the store/i],
39+
/add a new pet to the store/i
40+
);
41+
checkTab(/api/i, [/^pet$/i, /recursive/i], /recursive/i);
3242
});
3343

3444
it("loads a page with authentication", () => {

0 commit comments

Comments
 (0)