forked from baron/baron-sso
링크로 로그인 수정
This commit is contained in:
27
userfront/test/qr_scan_route_test.dart
Normal file
27
userfront/test/qr_scan_route_test.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:userfront/features/auth/presentation/qr_scan_route.dart';
|
||||
|
||||
void main() {
|
||||
group('buildQrApprovePath', () {
|
||||
test('스캔 값을 trim/encode 해서 approve 경로를 만든다', () {
|
||||
final result = buildQrApprovePath(
|
||||
' https://sss.hmac.kr/ql/abc-123?x=1&y=2 ',
|
||||
localeCode: 'ko',
|
||||
);
|
||||
|
||||
expect(
|
||||
result,
|
||||
'/ko/approve?ref=https%3A%2F%2Fsss.hmac.kr%2Fql%2Fabc-123%3Fx%3D1%26y%3D2',
|
||||
);
|
||||
});
|
||||
|
||||
test('현재 URI에서 locale을 추출한다', () {
|
||||
final result = buildQrApprovePath(
|
||||
'abc123',
|
||||
currentUri: Uri.parse('https://sss.hmac.kr/en/dashboard'),
|
||||
);
|
||||
|
||||
expect(result, '/en/approve?ref=abc123');
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user