验证20%

This commit is contained in:
rain
2026-07-31 11:31:26 +08:00
parent 309598bfa6
commit ac5823547a
24 changed files with 751 additions and 279 deletions
+24
View File
@@ -118,3 +118,27 @@ test('authentication captcha ticket is removed from the form when consumed', ()
assert.equal(field.value, '');
assert.equal(AuthPages.takeCaptchaToken(form), '');
});
test('successful login enters one real genealogy directly and otherwise opens the chooser', async () => {
assert.equal(
AuthPages.getPostLoginUrl([{ genealogyId: '2062179707935264769' }]),
'profile-family-home.html?genealogyId=2062179707935264769'
);
assert.equal(AuthPages.getPostLoginUrl([]), 'profile-families.html');
assert.equal(
AuthPages.getPostLoginUrl([{ genealogyId: '1' }, { genealogyId: '2' }]),
'profile-families.html'
);
assert.equal(
AuthPages.getPostLoginUrl([{ genealogyId: Number.MAX_SAFE_INTEGER + 1 }]),
'profile-families.html'
);
assert.equal(
await AuthPages.resolvePostLoginUrl({
genealogiesMine: async () => {
throw new Error('temporary failure');
}
}, 'login'),
'profile.html'
);
});