forked from baron/baron-sso
userfront&backend test coverage 추가
This commit is contained in:
@@ -43,6 +43,36 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('전용 verify 계열 라우트와 완료 라우트 경로를 식별한다', () {
|
||||
expect(
|
||||
buildLocalizedVerificationCompletePath('ko'),
|
||||
'/ko/verify-complete',
|
||||
);
|
||||
expect(isDedicatedVerificationRoute(Uri.parse('/verification')), isTrue);
|
||||
expect(isDedicatedVerificationRoute(Uri.parse('/ko/verify/abc')), isTrue);
|
||||
expect(isDedicatedVerificationRoute(Uri.parse('/en/l/SHORT123')), isTrue);
|
||||
expect(isDedicatedVerificationRoute(Uri.parse('/ko/signin')), isFalse);
|
||||
});
|
||||
|
||||
test('빈 pendingRef와 불완전한 payload는 리다이렉트 query에서 제외한다', () {
|
||||
expect(
|
||||
buildDedicatedVerificationRedirect(
|
||||
Uri.parse(
|
||||
'/signin?loginId=user%40example.com&code=123456&pendingRef=',
|
||||
),
|
||||
localeCode: 'en',
|
||||
),
|
||||
'/en/verify?loginId=user%40example.com&code=123456',
|
||||
);
|
||||
expect(
|
||||
buildDedicatedVerificationRedirect(
|
||||
Uri.parse('/signin?loginId=user%40example.com'),
|
||||
localeCode: 'en',
|
||||
),
|
||||
isNull,
|
||||
);
|
||||
});
|
||||
|
||||
test('이미 전용 verify 라우트면 다시 리다이렉트하지 않는다', () {
|
||||
final redirect = buildDedicatedVerificationRedirect(
|
||||
Uri.parse('/ko/verify?loginId=e2e%40example.com&code=654321'),
|
||||
|
||||
Reference in New Issue
Block a user