added support for 2fa login with browser flow
This commit is contained in:
@@ -53,6 +53,45 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('registrationTypesFor', () {
|
||||
test('password accounts maintain both registrations', () {
|
||||
expect(
|
||||
PushRegistration.registrationTypesFor(
|
||||
usesLoginFlow: false,
|
||||
hasTalkAppPassword: false,
|
||||
),
|
||||
PushRegistrationType.values,
|
||||
);
|
||||
expect(
|
||||
PushRegistration.registrationTypesFor(
|
||||
usesLoginFlow: false,
|
||||
hasTalkAppPassword: true,
|
||||
),
|
||||
PushRegistrationType.values,
|
||||
);
|
||||
});
|
||||
|
||||
test('flow account without talk app password is talk-only', () {
|
||||
expect(
|
||||
PushRegistration.registrationTypesFor(
|
||||
usesLoginFlow: true,
|
||||
hasTalkAppPassword: false,
|
||||
),
|
||||
[PushRegistrationType.talk],
|
||||
);
|
||||
});
|
||||
|
||||
test('flow account with second (talk) app password maintains both', () {
|
||||
expect(
|
||||
PushRegistration.registrationTypesFor(
|
||||
usesLoginFlow: true,
|
||||
hasTalkAppPassword: true,
|
||||
),
|
||||
PushRegistrationType.values,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
group('pushTokenVariant', () {
|
||||
test('general uses the raw token, talk appends the suffix', () {
|
||||
expect(pushTokenVariant('tok', PushRegistrationType.general), 'tok');
|
||||
|
||||
Reference in New Issue
Block a user