diff --git a/src/components/sprite-selector-item/sprite-selector-item.jsx b/src/components/sprite-selector-item/sprite-selector-item.jsx index 3f9ba049479..fd43da31231 100644 --- a/src/components/sprite-selector-item/sprite-selector-item.jsx +++ b/src/components/sprite-selector-item/sprite-selector-item.jsx @@ -26,13 +26,6 @@ const SpriteSelectorItem = props => ( disable={props.dragging} id={`${props.name}-${contextMenuId}`} > - {(props.selected && props.onDeleteButtonClick) ? ( - - ) : null } {typeof props.number === 'undefined' ? null : (
{props.number}
)} @@ -53,6 +46,13 @@ const SpriteSelectorItem = props => (
{props.details}
) : null} + {(props.selected && props.onDeleteButtonClick) ? ( + + ) : null } {props.onDuplicateButtonClick || props.onDeleteButtonClick || props.onExportButtonClick ? ( {props.onDuplicateButtonClick ? ( diff --git a/test/integration/sprites.test.js b/test/integration/sprites.test.js index 178fb6b984f..a3dd48cf4a5 100644 --- a/test/integration/sprites.test.js +++ b/test/integration/sprites.test.js @@ -76,6 +76,17 @@ describe('Working with sprites', () => { await expect(logs).toEqual([]); }); + test('Deleting by x button on sprite tile', async () => { + await loadUri(uri); + await clickXpath('//button[@title="Try It"]'); + await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation + await clickXpath('//*[@aria-label="Close"]'); // Only visible close button is on the sprite + // Confirm that the stage has been switched to + await findByText('Stage selected: no motion blocks'); + const logs = await getLogs(); + await expect(logs).toEqual([]); + }); + test('Adding a sprite by uploading a png', async () => { await loadUri(uri); await clickXpath('//button[@title="Try It"]'); diff --git a/test/unit/components/__snapshots__/sprite-selector-item.test.jsx.snap b/test/unit/components/__snapshots__/sprite-selector-item.test.jsx.snap index e0224d77c19..2aa7a98297e 100644 --- a/test/unit/components/__snapshots__/sprite-selector-item.test.jsx.snap +++ b/test/unit/components/__snapshots__/sprite-selector-item.test.jsx.snap @@ -13,18 +13,6 @@ exports[`SpriteSelectorItemComponent matches snapshot when given a number and de onTouchEnd={[Function]} onTouchStart={[Function]} > -
- -
@@ -57,6 +45,18 @@ exports[`SpriteSelectorItemComponent matches snapshot when given a number and de 480 x 360
+
+ +