diff --git a/test/integration/sounds.test.js b/test/integration/sounds.test.js index 7c306a5eee2c9c05c2d16d1c9ed8a1a489f5370c..ca1a3d275d8271e63af5068659429d4b4a4cee7e 100644 --- a/test/integration/sounds.test.js +++ b/test/integration/sounds.test.js @@ -33,8 +33,6 @@ describe('Working with sounds', () => { // Delete the sound await rightClickText('Meow', scope.soundsTab); await clickText('delete', scope.soundsTab); - await driver.switchTo().alert() - .accept(); // Add it back await clickXpath('//button[@aria-label="Choose a Sound"]'); diff --git a/test/integration/sprites.test.js b/test/integration/sprites.test.js index 41f2eec3ab4220e83fc08f8936c35328367f3da4..5b99efcb62e0496312d31f15e8746b260ad204a1 100644 --- a/test/integration/sprites.test.js +++ b/test/integration/sprites.test.js @@ -55,8 +55,6 @@ describe('Working with sprites', () => { await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation await rightClickText('Sprite1', scope.spriteTile); await clickText('delete', scope.spriteTile); - await driver.switchTo().alert() - .accept(); // Confirm that the stage has been switched to await findByText('Stage selected: no motion blocks'); const logs = await getLogs(); diff --git a/test/unit/containers/sprite-selector-item.test.jsx b/test/unit/containers/sprite-selector-item.test.jsx index 85032603d4b3a1712db3fb431a96d109dc40d7d7..f133c02a25789791f754e275edcfb58eb813c777 100644 --- a/test/unit/containers/sprite-selector-item.test.jsx +++ b/test/unit/containers/sprite-selector-item.test.jsx @@ -48,22 +48,11 @@ describe('SpriteSelectorItem Container', () => { onDeleteButtonClick = jest.fn(); dispatchSetHoveredSprite = jest.fn(); selected = true; - // Mock window.confirm() which is called when the close button is clicked. - global.confirm = jest.fn(() => true); }); - test('should confirm if the user really wants to delete the sprite', () => { + test('should delete the sprite', () => { const wrapper = mountWithIntl(getContainer()); wrapper.find(CloseButton).simulate('click'); - expect(global.confirm).toHaveBeenCalled(); expect(onDeleteButtonClick).toHaveBeenCalledWith(1337); }); - - test('should not delete the sprite if the user cancels', () => { - global.confirm = jest.fn(() => false); - const wrapper = mountWithIntl(getContainer()); - wrapper.find(CloseButton).simulate('click'); - expect(global.confirm).toHaveBeenCalled(); - expect(onDeleteButtonClick).not.toHaveBeenCalled(); - }); });