forked from finos/architecture-as-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.cy.ts
More file actions
48 lines (41 loc) · 1.49 KB
/
home.cy.ts
File metadata and controls
48 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import {namespaceInfos, namespaces, resourceTypes} from "../fixtures/constants.js";
describe('Home page tests', () => {
beforeEach(() => {
cy.intercept("/calm/namespaces", {"values": namespaceInfos})
})
it('Loads initial screen successfully', () => {
cy.visit('/');
cy.findByText("Explore").should("exist");
cy.findByText("Namespaces").should("exist");
namespaces.forEach(namespace => cy.findByText(namespace).should("exist"));
cy.findByText(namespaces[0]).click();
resourceTypes.forEach(resourceType => { cy.findByText(resourceType).should("exist"); });
})
context("Sidebar collapse", () => {
it("Collapses and expands the sidebar", () => {
cy.visit('/');
cy.findByText("Explore").should("exist");
cy.findByLabelText("Collapse sidebar").click();
cy.findByText("Explore").should("not.exist");
cy.findByLabelText("Expand sidebar").click();
cy.findByText("Explore").should("exist");
})
})
context("Wide screen tests", () => {
it("Finds navigation items", () => {
cy.viewport('macbook-16')
cy.visit('/');
cy.findByRole("link", { name: "Hub" })
cy.findByRole("link", { name: "Visualizer" })
})
})
context("Collapsed screen tests", () => {
it("Finds navigation items", () => {
cy.viewport(1000, 600)
cy.visit('/');
cy.findByRole("button", { name: "Open Menu" }).click();
cy.findByRole("link", { name: "Hub" })
cy.findByRole("link", { name: "Visualizer" })
})
})
})