Skip to content

Commit

Permalink
chore(tiles): fix failing tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettelerij committed Nov 12, 2024
1 parent bb97c99 commit 20d9575
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 10 additions & 12 deletions tests/cypress/e2e/styles.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
describe('OGC API Styles tests', () => {

Cypress.on("window:before:load", () => {
/**
* Thankfully, Cypress searches for "jQuery" property on the state
* variable (cy), if that's present, it takes the precedence
* over window.$
* https://github.com/cypress-io/cypress/blob/7.0-release/packages/driver/src/cy/jquery.js#L12
*/
cy.state("jQuery", Cypress.$);
});

it('styles page should have no a11y violations', () => {
cy.visit('/styles')
cy.injectAxe()
Expand All @@ -13,12 +23,6 @@ describe('OGC API Styles tests', () => {

it('styles page should have no broken links', () => {
cy.visit('/styles')

cy.on('window:before:load', (win) => {
if (win.jQuery === undefined && (win.$ === undefined || win.$ === {})) {
win.$ = Cypress.cy.$$;
}
});
cy.checkForBrokenLinks()
})

Expand All @@ -35,12 +39,6 @@ describe('OGC API Styles tests', () => {

it('style page should have no broken links', () => {
cy.visit('/styles/dummy-style')

cy.on('window:before:load', (win) => {
if (win.jQuery === undefined && (win.$ === undefined || win.$ === {})) {
win.$ = Cypress.cy.$$;
}
});
cy.checkForBrokenLinks()
})

Expand Down
10 changes: 10 additions & 0 deletions tests/cypress/e2e/tiles.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
describe('OGC API Tiles tests', () => {

Cypress.on("window:before:load", () => {
/**
* Thankfully, Cypress searches for "jQuery" property on the state
* variable (cy), if that's present, it takes the precedence
* over window.$
* https://github.com/cypress-io/cypress/blob/7.0-release/packages/driver/src/cy/jquery.js#L12
*/
cy.state("jQuery", Cypress.$);
});

it('dataset tiles page should have no a11y violations', () => {
cy.visit('/tiles')
cy.injectAxe()
Expand Down

0 comments on commit 20d9575

Please sign in to comment.