koel/cypress/integration/settings.spec.ts

35 lines
826 B
TypeScript
Raw Normal View History

2021-01-03 16:24:35 +00:00
context('Settings', () => {
beforeEach(() => {
cy.$login()
cy.$clickSidebarItem('Settings')
2021-01-04 21:28:09 +00:00
cy.intercept('POST', '/api/settings', {}).as('save')
2021-01-03 16:24:35 +00:00
})
2021-01-03 16:39:54 +00:00
it('rescans media', () => {
2021-01-03 16:24:35 +00:00
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()
})
2021-01-03 16:39:54 +00:00
2021-01-04 21:28:09 +00:00
cy.wait('@save')
2021-01-03 16:24:35 +00:00
})
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()
2021-01-04 21:28:09 +00:00
cy.wait('@save')
2021-01-03 16:24:35 +00:00
})
})