-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
3,763 additions
and
2,574 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
describe('Login flow', () => { | ||
const CMS_BASEURL = Cypress.env('BASEURL') | ||
const LOGIN_BUTTON_TEXT = 'Login with GitHub' | ||
const GITHUB_LOGIN_URL = 'https://github.com/login' | ||
describe("Login flow", () => { | ||
const CMS_BASEURL = Cypress.env("BASEURL") | ||
const LOGIN_BUTTON_TEXT = "Login with GitHub" | ||
const GITHUB_LOGIN_URL = "https://github.com/login" | ||
|
||
it('Home page should have login button', () => { | ||
it("Home page should have login button", () => { | ||
cy.visit(CMS_BASEURL) | ||
cy.get('button').should('have.text', LOGIN_BUTTON_TEXT) | ||
cy.get("button").should("have.text", LOGIN_BUTTON_TEXT) | ||
}) | ||
|
||
it('Login button should redirect to GitHub login on click', () => { | ||
it("Login button should redirect to GitHub login on click", () => { | ||
cy.visit(CMS_BASEURL) | ||
|
||
// This is necessary to prevent the frontend from throwing the 401 error from the backend. | ||
// TODO: We should handle this properly in the axios interceptor. | ||
cy.on('uncaught:exception', (err, runnable) => { | ||
cy.on("uncaught:exception", (err, runnable) => { | ||
// returning false here prevents Cypress from failing the test | ||
return false | ||
}) | ||
|
||
cy.contains(LOGIN_BUTTON_TEXT).click() | ||
cy.url().should('include', GITHUB_LOGIN_URL) | ||
cy.url().should("include", GITHUB_LOGIN_URL) | ||
}) | ||
}) | ||
}) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.