验证20%
This commit is contained in:
@@ -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'
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user