mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-06 13:34:50 +08:00
Fix risky test
This commit is contained in:
parent
767436610c
commit
d657e88dd8
@ -346,8 +346,7 @@ export default {
|
||||
inputValue: player.player_name,
|
||||
input: 'text',
|
||||
showCancelButton: true,
|
||||
inputValidator: /* istanbul ignore next */ value =>
|
||||
!value && this.$t('user.emptyPlayerName')
|
||||
inputValidator: value => !value && this.$t('user.emptyPlayerName')
|
||||
});
|
||||
if (dismiss) {
|
||||
return;
|
||||
|
@ -90,8 +90,14 @@ test('change player name', async () => {
|
||||
Vue.prototype.$http.post
|
||||
.mockResolvedValueOnce({ errno: 1 })
|
||||
.mockResolvedValue({ errno: 0 });
|
||||
swal.mockResolvedValueOnce({ dismiss: 1 })
|
||||
.mockResolvedValue({ value: 'new-name' });
|
||||
swal.mockImplementationOnce(() => ({ dismiss: 1 }))
|
||||
.mockImplementation(({ inputValidator }) => {
|
||||
if (inputValidator) {
|
||||
inputValidator();
|
||||
inputValidator('new-name');
|
||||
return { value: 'new-name' };
|
||||
}
|
||||
});
|
||||
const wrapper = mount(Players);
|
||||
await wrapper.vm.$nextTick();
|
||||
const button = wrapper.find('.btn-default');
|
||||
|
Loading…
Reference in New Issue
Block a user