Skip to content

Commit 9409383

Browse files
committed
add cypress test
1 parent 8b02bc2 commit 9409383

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

client/cypress/e2e/unit.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
describe("Unit page users", () => {
2-
it("can click and go to the second exercise", () => {
2+
it("can click and go to the exercise", () => {
33
const user = cy;
44
user
5-
.visit("/basics")
6-
.get(":nth-child(2) > .e7 > .b0.ai > .ek")
5+
.visit("/functional-programming")
6+
.get("li")
7+
.findByRole("button", { name: /Solve/i })
78
.click()
8-
.wait(6000)
99
.location()
1010
.should((location) => {
1111
// eslint-disable-next-line jest/valid-expect
1212
expect(location.pathname).to.eq(
13-
"/basics/what-will-be-the-output-of-the-code"
13+
"/functional-programming/shopping-challenge"
1414
);
1515
});
1616
});
17+
it("can click and go to another unit", () => {
18+
const user = cy;
19+
user
20+
.visit("/functional-programming")
21+
.wait(1000)
22+
.get("ul")
23+
.findByText("Speaking JavaScript")
24+
.click()
25+
.location()
26+
.should((location) => {
27+
// eslint-disable-next-line jest/valid-expect
28+
expect(location.pathname).to.eq("/speaking-javascript");
29+
});
30+
});
1731
});

0 commit comments

Comments
 (0)