forked from baron/baron-sso
userfront&backend test coverage 추가
This commit is contained in:
@@ -29,5 +29,47 @@ void main() {
|
||||
);
|
||||
expect(isPublic, isTrue);
|
||||
});
|
||||
|
||||
test('public auth path 목록을 허용하고 일반 보호 경로는 제외한다', () {
|
||||
final publicPaths = [
|
||||
'/signin',
|
||||
'/signup',
|
||||
'/login',
|
||||
'/registration',
|
||||
'/verify',
|
||||
'/verification',
|
||||
'/verify-complete',
|
||||
'/verify/token',
|
||||
'/l/AB123456',
|
||||
'/approve',
|
||||
'/ql/AB123456',
|
||||
'/forgot-password',
|
||||
'/recovery',
|
||||
'/reset-password',
|
||||
'/error',
|
||||
'/settings',
|
||||
'/consent',
|
||||
'/consent/challenge',
|
||||
];
|
||||
|
||||
for (final path in publicPaths) {
|
||||
expect(isPublicAuthPath(path, Uri.parse(path)), isTrue, reason: path);
|
||||
}
|
||||
|
||||
expect(
|
||||
isPublicAuthPath('/dashboard', Uri.parse('/ko/dashboard')),
|
||||
isFalse,
|
||||
);
|
||||
expect(
|
||||
isPublicAuthPath('/dashboard', Uri.parse('/ko/auth/consent/callback')),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('short code route가 아니면 null을 반환한다', () {
|
||||
expect(extractLoginShortCode(Uri.parse('/login')), isNull);
|
||||
expect(extractLoginShortCode(Uri.parse('/l')), isNull);
|
||||
expect(extractLoginShortCode(Uri.parse('/x/AB123456')), isNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user