mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-27 06:29:19 +08:00
Show chars captcha even "invisible" is on
This commit is contained in:
parent
c5eefbd061
commit
e2c6028196
@ -60,7 +60,7 @@ export default {
|
||||
methods: {
|
||||
execute() {
|
||||
return new Promise(resolve => {
|
||||
if (this.invisible) {
|
||||
if (this.recaptcha && this.invisible) {
|
||||
this.$refs.recaptcha.$once('verify', resolve)
|
||||
this.$refs.recaptcha.execute()
|
||||
} else {
|
||||
|
@ -41,8 +41,13 @@ test('display characters captcha', async () => {
|
||||
blessing.extra = {}
|
||||
const wrapper = mount<Vue & { execute(): Promise<string> }>(Captcha)
|
||||
expect(wrapper.find('img').exists()).toBeTrue()
|
||||
wrapper.find('input').setValue('abc')
|
||||
const input = wrapper.find('input')
|
||||
input.setValue('abc')
|
||||
expect(await wrapper.vm.execute()).toBe('abc')
|
||||
|
||||
wrapper.setData({ invisible: true })
|
||||
input.setValue('123')
|
||||
expect(await wrapper.vm.execute()).toBe('123')
|
||||
})
|
||||
|
||||
test('refresh captcha', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user