From a1efdd4746e60faf1fab11728c20c90d69820ec2 Mon Sep 17 00:00:00 2001 From: rudywaltz Date: Sat, 25 May 2019 21:26:05 +0200 Subject: [PATCH] fix(playlist): remove multiple song #9 --- cypress/integration/playlist.js | 8 ++++++++ src/components/Playlist.svelte | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cypress/integration/playlist.js b/cypress/integration/playlist.js index de35c79..478fda3 100644 --- a/cypress/integration/playlist.js +++ b/cypress/integration/playlist.js @@ -103,5 +103,13 @@ describe('playlist', () => { }]); }); }) + + it('removing song button working multiple time', () => { + cy.get(':nth-child(1) > .song__clear').click(); + cy.get(':nth-child(1) > .song__clear').click(); + cy + .get('.playlist') + .contains('Choose one song') + }) }) }); diff --git a/src/components/Playlist.svelte b/src/components/Playlist.svelte index e036feb..48d3962 100644 --- a/src/components/Playlist.svelte +++ b/src/components/Playlist.svelte @@ -6,7 +6,7 @@ $playlist = []; }; - const removeSong = songUrl => () => { + const removeSong = songUrl => { $playlist = $playlist.filter(song => song.url !== songUrl); }; @@ -40,14 +40,14 @@