This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/cypress/e2e/pages/application/index.cy.ts

35 lines
1.0 KiB
TypeScript

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 {}