Skip to content

Commit 415ecee

Browse files
committed
Update tests
1 parent d1e6960 commit 415ecee

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

test/integration/sprites.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('Working with sprites', () => {
7575
test('Deleting by x button on sprite tile', async () => {
7676
await loadUri(uri);
7777
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation
78-
await clickXpath('//*[@aria-label="Close"]'); // Only visible close button is on the sprite
78+
await clickXpath('//*[@aria-label="Delete"]'); // Only visible close button is on the sprite
7979
// Confirm that the stage has been switched to
8080
await findByText('Stage selected: no motion blocks');
8181
const logs = await getLogs();

test/unit/components/__snapshots__/sprite-selector-item.test.jsx.snap

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,20 @@ exports[`SpriteSelectorItemComponent matches snapshot when given a number and de
4646
</div>
4747
</div>
4848
<div
49-
aria-label="Close"
49+
aria-label="Delete"
5050
className=""
5151
onClick={[Function]}
5252
role="button"
5353
tabIndex="0"
5454
>
55-
<img
56-
className=""
57-
src="test-file-stub"
58-
/>
55+
<div
56+
className={undefined}
57+
>
58+
<img
59+
className={undefined}
60+
src="test-file-stub"
61+
/>
62+
</div>
5963
</div>
6064
<nav
6165
className="react-contextmenu"
@@ -126,16 +130,20 @@ exports[`SpriteSelectorItemComponent matches snapshot when selected 1`] = `
126130
</div>
127131
</div>
128132
<div
129-
aria-label="Close"
133+
aria-label="Delete"
130134
className=""
131135
onClick={[Function]}
132136
role="button"
133137
tabIndex="0"
134138
>
135-
<img
136-
className=""
137-
src="test-file-stub"
138-
/>
139+
<div
140+
className={undefined}
141+
>
142+
<img
143+
className={undefined}
144+
src="test-file-stub"
145+
/>
146+
</div>
139147
</div>
140148
<nav
141149
className="react-contextmenu"

test/unit/components/sprite-selector-item.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import {mountWithIntl, shallowWithIntl, componentWithIntl} from '../../helpers/intl-helpers.jsx';
33
import SpriteSelectorItemComponent from '../../../src/components/sprite-selector-item/sprite-selector-item';
4-
import CloseButton from '../../../src/components/close-button/close-button';
4+
import DeleteButton from '../../../src/components/delete-button/delete-button';
55

66
describe('SpriteSelectorItemComponent', () => {
77
let className;
@@ -56,7 +56,7 @@ describe('SpriteSelectorItemComponent', () => {
5656
test('does not have a close box when not selected', () => {
5757
selected = false;
5858
const wrapper = shallowWithIntl(getComponent());
59-
expect(wrapper.find(CloseButton).exists()).toBe(false);
59+
expect(wrapper.find(DeleteButton).exists()).toBe(false);
6060
});
6161

6262
test('triggers callback when Box component is clicked', () => {
@@ -68,7 +68,7 @@ describe('SpriteSelectorItemComponent', () => {
6868

6969
test('triggers callback when CloseButton component is clicked', () => {
7070
const wrapper = shallowWithIntl(getComponent());
71-
wrapper.find(CloseButton).simulate('click');
71+
wrapper.find(DeleteButton).simulate('click');
7272
expect(onDeleteButtonClick).toHaveBeenCalled();
7373
});
7474

test/unit/containers/sprite-selector-item.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import configureStore from 'redux-mock-store';
44
import {Provider} from 'react-redux';
55

66
import SpriteSelectorItem from '../../../src/containers/sprite-selector-item';
7-
import CloseButton from '../../../src/components/close-button/close-button';
7+
import DeleteButton from '../../../src/components/delete-button/delete-button';
88

99
describe('SpriteSelectorItem Container', () => {
1010
const mockStore = configureStore();
@@ -52,7 +52,7 @@ describe('SpriteSelectorItem Container', () => {
5252

5353
test('should delete the sprite', () => {
5454
const wrapper = mountWithIntl(getContainer());
55-
wrapper.find(CloseButton).simulate('click');
55+
wrapper.find(DeleteButton).simulate('click');
5656
expect(onDeleteButtonClick).toHaveBeenCalledWith(1337);
5757
});
5858
});

0 commit comments

Comments
 (0)