diff --git a/resources/assets/src/components/user/ClosetItem.vue b/resources/assets/src/components/user/ClosetItem.vue index 432e4145..acb9c4ce 100644 --- a/resources/assets/src/components/user/ClosetItem.vue +++ b/resources/assets/src/components/user/ClosetItem.vue @@ -26,7 +26,7 @@ diff --git a/resources/assets/tests/components/user/ClosetItem.test.js b/resources/assets/tests/components/user/ClosetItem.test.js index fb1f3b39..0cfc57de 100644 --- a/resources/assets/tests/components/user/ClosetItem.test.js +++ b/resources/assets/tests/components/user/ClosetItem.test.js @@ -87,6 +87,7 @@ test('remove texture', async () => { expect(wrapper.emitted()['item-removed']).toBeTruthy() expect(Vue.prototype.$http.post).toBeCalledWith('/user/closet/remove', { tid: 1 }) }) + test('set as avatar', async () => { Vue.prototype.$http.post .mockResolvedValueOnce({ errno: 0 }) @@ -121,3 +122,9 @@ test('set as avatar', async () => { expect(Vue.prototype.$http.post).toBeCalledWith('/user/profile/avatar', { tid: 1 }) expect(window.$).toBeCalledWith('[alt="User Image"]') }) + +test('no avatar option if texture is cape', () => { + const wrapper = mount(ClosetItem, { propsData: factory({ type: 'cape' }) }) + const button = wrapper.findAll('.dropdown-menu > li').at(2) + expect(button.isEmpty()).toBeTrue() +})