Skip to content

Commit 54ea46a

Browse files
committed
Update tests for app img display
If there's an image, it takes precedence over icon (which always has a default)
1 parent 8782612 commit 54ea46a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/web-app-files/tests/unit/components/ActionMenuItem.spec.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,10 @@ describe('ActionMenuItem component', () => {
3131
})
3232
it('renders an image if there is one defined in the action', () => {
3333
const action = { ...fileActions.download, img: 'https://owncloud.tld/img.png' }
34-
const wrapper1 = getShallowWrapper(action)
35-
expect(wrapper1.find(selectors.icon).exists()).toBeTruthy()
36-
expect(wrapper1.find(selectors.icon).attributes().name).toBe(action.icon)
37-
delete action.icon
38-
const wrapper2 = getShallowWrapper(action)
39-
expect(wrapper2.find(selectors.icon).exists()).toBeFalsy()
40-
expect(wrapper2.find(selectors.img).exists()).toBeTruthy()
41-
expect(wrapper2.find(selectors.img).attributes().src).toBe(action.img)
34+
const wrapper = getShallowWrapper(action)
35+
expect(wrapper.find(selectors.icon).exists()).toBeFalsy()
36+
expect(wrapper.find(selectors.img).exists()).toBeTruthy()
37+
expect(wrapper.find(selectors.img).attributes().src).toBe(action.img)
4238
})
4339
it('renders the action label', () => {
4440
const action = fileActions.download

0 commit comments

Comments
 (0)