-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsliders.spec.js
More file actions
52 lines (51 loc) · 1.74 KB
/
Copy pathsliders.spec.js
File metadata and controls
52 lines (51 loc) · 1.74 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
49
50
51
52
/**
* First, we need to check that the sliders work correctly before relying on them
*
* cy.slideNetworkSlider and cy.slidePlaceholderSlider are declared in support/commands.shared.js
*/
describe("Sliders", () => {
describe("Network Slider", () => {
before(() => {
cy.visit("/suspense/regular-rendering");
});
it("should update network mode to slowNetwork", () => {
cy.slideNetworkSlider("slowNetwork")
.getByTestId("network-slider-wrapper")
.getByText(/slowNetwork/);
});
it("should update network mode to fastNetwork", () => {
cy.slideNetworkSlider("fastNetwork")
.getByTestId("network-slider-wrapper")
.getByText(/fastNetwork/);
});
it("should update network mode to slowEndPoint", () => {
cy.slideNetworkSlider("slowEndPoint")
.getByTestId("network-slider-wrapper")
.getByText(/slowEndPoint/);
});
});
describe("Placeholder Slider", () => {
before(() => {
cy.visit("/suspense/placeholder");
});
[1000, 1500, 2000, 2600, 4300, 5000, 6700, 7800, 8900, 9300].forEach(
duration => {
it(`should update placeholder preview delayMs=${duration}`, () => {
cy.slidePlaceholderSlider(duration).then(() => {
cy.getByTestId("placeholder-preview").contains(duration);
});
});
}
);
[1000, 1500, 2000, 2600, 4300, 5000, 6700, 7800, 8900, 9300].forEach(
duration => {
it(`should update delayMs param in url with /${duration}`, () => {
cy.slidePlaceholderSlider(duration).then(() => {
cy.getByTestId("placeholder-preview").contains(duration);
cy.url().should("match", new RegExp(`/${duration}$`));
});
});
}
);
});
});