mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
chore: add tests for remote
This commit is contained in:
parent
3958bd51ff
commit
3a5f585ea6
3 changed files with 14 additions and 3 deletions
11
cypress/integration/remote.spec.js
Normal file
11
cypress/integration/remote.spec.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
describe('remote', () => {
|
||||
it('requires login', () => {
|
||||
cy.visit('/remote')
|
||||
cy.get(['data=cy-loginForm']).should('be.visible')
|
||||
})
|
||||
|
||||
it('logs in with valid username and password', () => {
|
||||
cy.login('/remote')
|
||||
cy.get('[data-cy=main]').should('be.visible')
|
||||
})
|
||||
})
|
|
@ -24,12 +24,12 @@
|
|||
// -- This is will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
Cypress.Commands.add('login', (email = 'me@phanan.net', password = 'secret') => {
|
||||
Cypress.Commands.add('login', (path = '/', email = 'me@phanan.net', password = 'secret') => {
|
||||
cy.server()
|
||||
cy.route('POST', '/api/me', 'fixture:token.json')
|
||||
cy.route('GET', '/api/data', 'fixture:data.json')
|
||||
cy.route('GET', '/api/ping', '')
|
||||
cy.visit('/')
|
||||
cy.visit(path)
|
||||
cy.get('[type=email]').type(email)
|
||||
cy.get('[type=password]').type(password)
|
||||
cy.get('[type=submit]').click()
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4abb84d8478f2417824f7e508cc79a24ed9ec038
|
||||
Subproject commit 2f14afc2e8a6e1c9579b38abf681572d888cbf90
|
Loading…
Reference in a new issue