fix: some broken e2e tests

This commit is contained in:
Phan An 2021-05-23 14:32:38 +02:00
parent f391e6f6e7
commit 95ed9ab221
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
4 changed files with 29 additions and 4 deletions

View 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
}
}
}
]

View file

@ -36,8 +36,8 @@ context('Favorites', { scrollBehavior: false }, () => {
}) })
it('adds a favorite song from Add To dropdown', () => { it('adds a favorite song from Add To dropdown', () => {
cy.intercept('POST', '/api/interaction/like', { cy.intercept('POST', '/api/interaction/batch/like', {
fixture: 'like.post.200.json' fixture: 'batch-like.post.200.json'
}) })
cy.$clickSidebarItem('All Songs') cy.$clickSidebarItem('All Songs')

View file

@ -23,12 +23,16 @@ context('Sidebar Functionalities', () => {
} }
it('contains menu items', () => { it('contains menu items', () => {
cy.on('uncaught:exception', err => !err.message.includes('Request failed'))
cy.$login() cy.$login()
cy.$each(commonMenuItems, assertMenuItem) cy.$each(commonMenuItems, assertMenuItem)
cy.$each(managementMenuItems, assertMenuItem) cy.$each(managementMenuItems, assertMenuItem)
}) })
it('does not contain management items for non-admins', () => { it('does not contain management items for non-admins', () => {
cy.on('uncaught:exception', err => !err.message.includes('Request failed'))
cy.$loginAsNonAdmin() cy.$loginAsNonAdmin()
cy.$each(commonMenuItems, assertMenuItem) cy.$each(commonMenuItems, assertMenuItem)

View file

@ -142,8 +142,8 @@ context('Song Context Menu', { scrollBehavior: false }, () => {
}) })
it('adds a favorite song from context menu', () => { it('adds a favorite song from context menu', () => {
cy.intercept('POST', '/api/interaction/like', { cy.intercept('POST', '/api/interaction/batch/like', {
fixture: 'like.post.200.json' fixture: 'batch-like.post.200.json'
}) })
cy.$login() cy.$login()