-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.spec.js
59 lines (57 loc) · 1.63 KB
/
index.spec.js
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
53
54
55
56
57
58
59
/// <reference types="cypress" />
/// <reference types="cypress-axe" />
describe("Home page", () => {
before(() => {
cy.routePageDataRequests()
})
it("should be with correct url", () => {
cy.visit("/")
cy.wait("@appData")
cy.wait("@indexPageData")
cy.url().should("contain", "/")
})
it("should have no detectable accessibility violations on load", () => {
cy.injectAxe()
cy.wait(500)
cy.checkA11y()
})
it("should have canonical URL on meta", () => {
cy.get("head link[rel=canonical]").should(
"have.attr",
"href",
"https://multei.com.br/"
)
})
it("should have site title present on header", () => {
cy.get('header[role="banner"] h1 a').contains("Multei!")
})
})
describe("Parking report page", () => {
before(() => {
cy.routePageDataRequests()
cy.setFeatureToggle("GET_USER_MEDIA", false)
cy.setFeatureToggle("PARKING_CHECK", false)
cy.setFeatureToggle("PARKING_REPORT", true)
})
it("should be with correct URL", () => {
cy.visit("/denunciar")
cy.wait("@appData")
cy.wait("@reportPageData")
cy.url().should("contain", "/denunciar")
})
it("should have no detectable accessibility violations on load", () => {
cy.injectAxe()
cy.wait(500)
cy.checkA11y()
})
it("should have canonical URL on meta", () => {
cy.get("head link[rel=canonical]").should(($el) => {
expect($el).to.have.length(1)
const href = $el[0].href
expect(href).to.match(new RegExp("https://multei.com.br"))
})
})
it("should have site title present on header", () => {
cy.get('header[role="banner"] h1 a').contains("Multei!")
})
})