mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: some broken e2e tests
This commit is contained in:
parent
f391e6f6e7
commit
95ed9ab221
4 changed files with 29 additions and 4 deletions
21
cypress/fixtures/batch-like.post.200.json
Normal file
21
cypress/fixtures/batch-like.post.200.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
[
|
||||
{
|
||||
"song_id": "03bebf17f54e2afc7c0513fb1d931009",
|
||||
"liked": true,
|
||||
"song": {
|
||||
"id": "03bebf17f54e2afc7c0513fb1d931009",
|
||||
"album_id": 5,
|
||||
"artist_id": 3,
|
||||
"title": "Instinct",
|
||||
"length": 204.11,
|
||||
"track": null,
|
||||
"disc": 1,
|
||||
"created_at": "2019-08-24 18:03:35",
|
||||
"artist": {
|
||||
"id": 3,
|
||||
"name": "The Band",
|
||||
"image": null
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
|
@ -36,8 +36,8 @@ context('Favorites', { scrollBehavior: false }, () => {
|
|||
})
|
||||
|
||||
it('adds a favorite song from Add To dropdown', () => {
|
||||
cy.intercept('POST', '/api/interaction/like', {
|
||||
fixture: 'like.post.200.json'
|
||||
cy.intercept('POST', '/api/interaction/batch/like', {
|
||||
fixture: 'batch-like.post.200.json'
|
||||
})
|
||||
|
||||
cy.$clickSidebarItem('All Songs')
|
||||
|
|
|
@ -23,12 +23,16 @@ context('Sidebar Functionalities', () => {
|
|||
}
|
||||
|
||||
it('contains menu items', () => {
|
||||
cy.on('uncaught:exception', err => !err.message.includes('Request failed'))
|
||||
|
||||
cy.$login()
|
||||
cy.$each(commonMenuItems, assertMenuItem)
|
||||
cy.$each(managementMenuItems, assertMenuItem)
|
||||
})
|
||||
|
||||
it('does not contain management items for non-admins', () => {
|
||||
cy.on('uncaught:exception', err => !err.message.includes('Request failed'))
|
||||
|
||||
cy.$loginAsNonAdmin()
|
||||
cy.$each(commonMenuItems, assertMenuItem)
|
||||
|
||||
|
|
|
@ -142,8 +142,8 @@ context('Song Context Menu', { scrollBehavior: false }, () => {
|
|||
})
|
||||
|
||||
it('adds a favorite song from context menu', () => {
|
||||
cy.intercept('POST', '/api/interaction/like', {
|
||||
fixture: 'like.post.200.json'
|
||||
cy.intercept('POST', '/api/interaction/batch/like', {
|
||||
fixture: 'batch-like.post.200.json'
|
||||
})
|
||||
|
||||
cy.$login()
|
||||
|
|
Loading…
Reference in a new issue