release: v1.2.1 — login captcha, docs site, and bug fixes
Add slider captcha for web login, VitePress documentation on GitHub Pages, and fixes for gallery delete refresh, pagination jump, and copy-format persistence.
This commit is contained in:
1 parent
469d3be735
commit
ff20f97522
66 files changed
+2497
-616
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
__peekLoginCaptchaTargetForTests,
|
||||
__resetLoginCaptchaStoreForTests,
|
||||
confirmLoginCaptcha,
|
||||
createLoginCaptchaChallenge,
|
||||
verifyLoginCaptcha
|
||||
} from './login-captcha'
|
||||
|
||||
describe('login-captcha', () => {
|
||||
it('requires confirm before login verify', () => {
|
||||
__resetLoginCaptchaStoreForTests()
|
||||
const { id } = createLoginCaptchaChallenge()
|
||||
const target = __peekLoginCaptchaTargetForTests(id)!
|
||||
expect(verifyLoginCaptcha(id, target)).toBe(false)
|
||||
expect(confirmLoginCaptcha(id, target)).toBe(true)
|
||||
expect(verifyLoginCaptcha(id, target)).toBe(true)
|
||||
expect(verifyLoginCaptcha(id, target)).toBe(false)
|
||||
})
|
||||
|
||||
it('rejects position outside tolerance', () => {
|
||||
__resetLoginCaptchaStoreForTests()
|
||||
const { id } = createLoginCaptchaChallenge()
|
||||
const target = __peekLoginCaptchaTargetForTests(id)!
|
||||
expect(confirmLoginCaptcha(id, target + 10)).toBe(false)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user