Skip to content

Commit

Permalink
feat(cypress): add tests for legal pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Feb 13, 2023
1 parent ab0a40a commit d392110
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cypress/e2e/legalnotice.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('legal-notice page', () => {
context('page load', () => {
it('loads the page successfully', () => {
cy.request('/legal-notice').then((resp) => {
expect(resp.status).to.equal(200)
expect(resp.redirectedToUrl).to.equal(undefined)
})
})
})

context('visual regression', () => {
it('looks as before', () => {
cy.setCookie('cookie_control_is_consent_given', 'true')
cy.visit('/legal-notice')
cy.get('[data-is-loading="false"]').should('be.visible')
cy.get('[data-testid="nuxt-cookie-control-control-button"]').should(
'be.visible'
)
cy.compareSnapshot('legal-notice')
})
})
})
22 changes: 22 additions & 0 deletions cypress/e2e/privacypolicy.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('privacy-policy page', () => {
context('page load', () => {
it('loads the page successfully', () => {
cy.request('/privacy-policy').then((resp) => {
expect(resp.status).to.equal(200)
expect(resp.redirectedToUrl).to.equal(undefined)
})
})
})

context('visual regression', () => {
it('looks as before', () => {
cy.setCookie('cookie_control_is_consent_given', 'true')
cy.visit('/privacy-policy')
cy.get('[data-is-loading="false"]').should('be.visible')
cy.get('[data-testid="nuxt-cookie-control-control-button"]').should(
'be.visible'
)
cy.compareSnapshot('privacy-policy')
})
})
})
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d392110

Please sign in to comment.