chore(test): add smart playlist into data fixture

This commit is contained in:
Phan An 2020-12-31 22:04:57 +01:00
parent 265d89918a
commit 111ad75a0d
5 changed files with 72 additions and 6 deletions

View file

@ -431,6 +431,40 @@
"name": "Simple Playlist",
"rules": null,
"is_smart": false
},
{
"name": "Smart Playlist",
"rules": [
{
"id": 1609438260491,
"rules": [
{
"id": 1609438270184,
"model": "length",
"operator": "isGreaterThan",
"value": [
"40"
]
}
]
},
{
"id": 1609438286276,
"rules": [
{
"id": 1609438289914,
"model": "title",
"operator": "is",
"value": [
"Whatever"
]
}
]
}
],
"id": 2,
"is_smart": true,
"songs": []
}
],
"interactions": [

View file

@ -431,6 +431,40 @@
"name": "Simple Playlist",
"rules": null,
"is_smart": false
},
{
"name": "Smart Playlist",
"rules": [
{
"id": 1609438260491,
"rules": [
{
"id": 1609438270184,
"model": "length",
"operator": "isGreaterThan",
"value": [
"40"
]
}
]
},
{
"id": 1609438286276,
"rules": [
{
"id": 1609438289914,
"model": "title",
"operator": "is",
"value": [
"Whatever"
]
}
]
}
],
"id": 2,
"is_smart": true,
"songs": []
}
],
"interactions": [

View file

@ -28,7 +28,7 @@
]
}
],
"id": 1,
"id": 3,
"is_smart": true,
"songs": []
}

View file

@ -1,7 +1,7 @@
{
"name": "A New Playlist",
"rules": null,
"id": 2,
"id": 3,
"is_smart": false,
"songs": []
}

View file

@ -48,7 +48,7 @@ context('Playlists', () => {
})
it('creates a simple playlist from the sidebar', () => {
cy.intercept('GET', '/api/playlist/2/songs', [])
cy.intercept('GET', '/api/playlist/3/songs', [])
cy.intercept('POST', '/api/playlist', {
fixture: 'playlist.post.200.json'
@ -113,13 +113,11 @@ context('Playlists', () => {
})
it('creates a smart playlist', () => {
cy.intercept('GET', '/api/playlist/2/songs', [])
cy.intercept('POST', '/api/playlist', {
fixture: 'playlist-smart.post.200.json'
})
cy.intercept('GET', '/api/playlist/1/songs', {
cy.intercept('GET', '/api/playlist/3/songs', {
fixture: 'playlist-songs.get.200.json'
})