2021-01-03 16:24:35 +00:00
|
|
|
context('Settings', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.$login()
|
|
|
|
cy.$clickSidebarItem('Settings')
|
2022-04-27 21:48:49 +00:00
|
|
|
cy.intercept('PUT', '/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
|
|
|
})
|
|
|
|
})
|