mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-06 13:34:50 +08:00
Hide setAsAvatar
if texture is cape
This commit is contained in:
parent
afb65615b0
commit
70c9226bf8
@ -26,7 +26,7 @@
|
||||
<ul class="dropup dropdown-menu" aria-labelledby="more-button">
|
||||
<li><a v-t="'user.renameItem'" @click="rename" /></li>
|
||||
<li><a v-t="'user.removeItem'" @click="remove" /></li>
|
||||
<li><a v-t="'user.setAsAvatar'" @click="setAsAvatar" /></li>
|
||||
<li><a v-if="type !== 'cape'" v-t="'user.setAsAvatar'" @click="setAsAvatar" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user