2
2
mirror of https://github.com/Thream/website.git synced 2024-07-21 09:28:32 +02:00
website/cypress/e2e/pages/application/index.cy.ts

35 lines
1.0 KiB
TypeScript
Raw Normal View History

import { authenticationHandlers } from '../../../fixtures/handler'
describe('Pages > /application', () => {
beforeEach(() => {
cy.task('stopMockServer')
})
it('should redirect user to `/application/guilds/create` on click on "Create a Guild"', () => {
cy.task('startMockServer', [...authenticationHandlers]).setCookie(
'refreshToken',
'refresh-token'
)
cy.visit('/application')
cy.get('[data-cy=application-title]').should('have.text', 'Application')
cy.get('a[href="/application/guilds/create"]')
.click()
.location('pathname')
.should('eq', '/application/guilds/create')
})
it('should redirect user to `/application/guilds/join` on click on "Join a Guild"', () => {
cy.task('startMockServer', [...authenticationHandlers]).setCookie(
'refreshToken',
'refresh-token'
)
cy.visit('/application')
cy.get('a[href="/application/guilds/join"]')
.click()
.location('pathname')
.should('eq', '/application/guilds/join')
})
})
export {}