Skip to content

Commit

Permalink
fix(test): only run test on >=nc30
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
  • Loading branch information
elzody committed Aug 13, 2024
1 parent b0047f1 commit 2aea268
Showing 1 changed file with 56 additions and 54 deletions.
110 changes: 56 additions & 54 deletions cypress/e2e/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,59 +298,61 @@ describe('Pages', function() {
})
})

describe('Search dialog', () => {
beforeEach(() => {
cy.get('input[name="pageFilter"]').type('collective')
cy.get('.search-dialog__container', { timeout: 5000 })
.should('be.visible')
.as('searchDialog')
})

it('Shows search dialog', () => {
cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Found 5 matches for "collective"')
})

it('Clears search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Clear search"]')
.click()
cy.get('@searchDialog').should('not.exist')
})

it('Toggles highlight all', () => {
cy.get('.search-dialog__highlight-all')
.find('span.checkbox-radio-switch-checkbox')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 1 of 5 for "collective"')
if (!['stable27', 'stable28', 'stable29'].includes(Cypress.env('ncVersion'))) {
describe('Search dialog', () => {
beforeEach(() => {
cy.get('input[name="pageFilter"]').type('collective')
cy.get('.search-dialog__container', { timeout: 5000 })
.should('be.visible')
.as('searchDialog')
})

it('Shows search dialog', () => {
cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Found 5 matches for "collective"')
})

it('Clears search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Clear search"]')
.click()
cy.get('@searchDialog').should('not.exist')
})

it('Toggles highlight all', () => {
cy.get('.search-dialog__highlight-all')
.find('span.checkbox-radio-switch-checkbox')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 1 of 5 for "collective"')
})

it('Moves to next search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Find next match"]')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 2 of 5 for "collective"')
})

it('Moves to previous search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Find previous match"]')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 5 of 5 for "collective"')
})
})

it('Moves to next search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Find next match"]')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 2 of 5 for "collective"')
})

it('Moves to previous search', () => {
cy.get('.search-dialog__buttons')
.find('button[aria-label="Find previous match"]')
.click()

cy.get('.search-dialog__info')
.invoke('text')
.invoke('trim')
.should('equal', 'Match 5 of 5 for "collective"')
})
})
}
})

0 comments on commit 2aea268

Please sign in to comment.