mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 09:04:44 -04:00
feat: merge login, register and intro page
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
76ef2511e7
commit
56643ffd85
39 changed files with 533 additions and 374 deletions
|
@ -7,18 +7,33 @@ import type { AuthProvider } from '../../src/api/config/types'
|
|||
import { AuthProviderType } from '../../src/api/config/types'
|
||||
|
||||
const initLoggedOutTestWithCustomAuthProviders = (cy: Cypress.cy, enabledProviders: AuthProvider[]) => {
|
||||
cy.logOut()
|
||||
cy.loadConfig({
|
||||
authProviders: enabledProviders
|
||||
})
|
||||
cy.visitHome()
|
||||
cy.logout()
|
||||
cy.visitHistory()
|
||||
}
|
||||
|
||||
describe('When logged-in, ', () => {
|
||||
it('sign-in button is hidden', () => {
|
||||
cy.visitHome()
|
||||
cy.visitHistory()
|
||||
cy.getByCypressId('base-app-bar').should('be.visible')
|
||||
cy.getByCypressId('sign-in-button').should('not.exist')
|
||||
})
|
||||
describe('login page route will redirect', () => {
|
||||
it('to /history if no redirect url has been provided', () => {
|
||||
cy.visit('/login')
|
||||
cy.url().should('contain', '/history')
|
||||
})
|
||||
it('to any page if a redirect url has been provided', () => {
|
||||
cy.visit('/login?redirectBackTo=/profile')
|
||||
cy.url().should('contain', '/profile')
|
||||
})
|
||||
it('to /history if a external redirect url has been provided', () => {
|
||||
cy.visit('/login?redirectBackTo=https://example.org')
|
||||
cy.url().should('contain', '/history')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('When logged-out ', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue