Show chars captcha even "invisible" is on
This commit is contained in:
parent
c5eefbd061
commit
e2c6028196
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
execute() {
|
execute() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (this.invisible) {
|
if (this.recaptcha && this.invisible) {
|
||||||
this.$refs.recaptcha.$once('verify', resolve)
|
this.$refs.recaptcha.$once('verify', resolve)
|
||||||
this.$refs.recaptcha.execute()
|
this.$refs.recaptcha.execute()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,13 @@ test('display characters captcha', async () => {
|
||||||
blessing.extra = {}
|
blessing.extra = {}
|
||||||
const wrapper = mount<Vue & { execute(): Promise<string> }>(Captcha)
|
const wrapper = mount<Vue & { execute(): Promise<string> }>(Captcha)
|
||||||
expect(wrapper.find('img').exists()).toBeTrue()
|
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')
|
expect(await wrapper.vm.execute()).toBe('abc')
|
||||||
|
|
||||||
|
wrapper.setData({ invisible: true })
|
||||||
|
input.setValue('123')
|
||||||
|
expect(await wrapper.vm.execute()).toBe('123')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('refresh captcha', () => {
|
test('refresh captcha', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user