koel/cypress/integration/settings.spec.ts
2021-01-04 22:28:09 +01:00

34 lines
826 B
TypeScript

context('Settings', () => {
beforeEach(() => {
cy.$login()
cy.$clickSidebarItem('Settings')
cy.intercept('POST', '/api/settings', {}).as('save')
})
it('rescans media', () => {
cy.get('#settingsWrapper').within(() => {
cy.get('.screen-header')
.should('be.visible')
.and('contain.text', 'Settings')
cy.get('[name=media_path]').should('have.value', '/media/koel/')
cy.get('[type=submit]').click()
})
cy.wait('@save')
})
it('confirms before rescanning if media path is changed', () => {
cy.get('#settingsWrapper').within(() => {
cy.get('[name=media_path]')
.should('have.value', '/media/koel/')
.clear()
.type('/var/media/koel')
cy.get('[type=submit]').click()
})
cy.$confirm()
cy.wait('@save')
})
})