forked from baron/baron-sso
55 lines
2.0 KiB
Markdown
55 lines
2.0 KiB
Markdown
# Issue #269 테스트 시나리오
|
|
|
|
## 목적
|
|
`/{locale}/` 라우팅 도입 이후 query parameter 유실 회귀를 방지합니다.
|
|
|
|
## 범위
|
|
- UserFront locale 경로 보정 (`buildLocalizedPath`)
|
|
- 비로그인 redirect 경로 생성 (`buildSigninRedirectPath`)
|
|
- locale 지원 목록 동기화 (`assets/translations/*.toml` -> `LocaleRegistry`)
|
|
|
|
## 테스트 시나리오
|
|
|
|
### S1. locale 보정 시 기본 query 보존
|
|
- 입력: `/signin?redirect_uri=https://example.com`
|
|
- 기대: `/ko/signin?redirect_uri=https://example.com`
|
|
|
|
### S2. locale 보정 시 raw query 순서/중복 key 보존
|
|
- 입력: `/signin?a=1&a=2&redirect_uri=https%3A%2F%2Fexample.com%2Fcb%3Fx%3D1%26y%3D2`
|
|
- 기대: `/ko/signin?a=1&a=2&redirect_uri=https%3A%2F%2Fexample.com%2Fcb%3Fx%3D1%26y%3D2`
|
|
|
|
### S3. locale 보정 시 fragment 보존
|
|
- 입력: `/signin?notice=qr_login_required#auth`
|
|
- 기대: `/ko/signin?notice=qr_login_required#auth`
|
|
|
|
### S4. unknown 2-letter prefix 오인 제거
|
|
- 입력: `/zz/signin`
|
|
- 기대: `/ko/zz/signin`
|
|
|
|
### S5. 비로그인 redirect에서 query 없음
|
|
- 입력: locale=`ko`, uri=`/ko/profile`
|
|
- 기대: `/ko/signin`
|
|
|
|
### S6. 비로그인 redirect에서 query 전체 보존
|
|
- 입력: locale=`ko`, uri=`/ko/profile?a=1&a=2&redirect_uri=https%3A%2F%2Fexample.com%2Fcb%3Fx%3D1%26y%3D2¬ice=qr_login_required`
|
|
- 기대: `/ko/signin?a=1&a=2&redirect_uri=https%3A%2F%2Fexample.com%2Fcb%3Fx%3D1%26y%3D2¬ice=qr_login_required`
|
|
|
|
### S7. locale 목록 하드코딩 제거 검증
|
|
- 입력: asset 목록 (`assets/translations/en.toml`, `assets/translations/ko.toml`, `assets/translations/template.toml`, 기타 invalid 파일)
|
|
- 기대:
|
|
- `template.toml` 제외
|
|
- 유효 locale 파일(`en.toml`, `ko.toml`)만 지원 목록에 반영
|
|
|
|
## 실행 방법
|
|
```bash
|
|
cd userfront
|
|
flutter test test/locale_utils_test.dart
|
|
flutter test test/locale_registry_test.dart
|
|
```
|
|
|
|
## 자동화 매핑
|
|
- `userfront/test/locale_utils_test.dart`
|
|
- S1~S6 전부 커버
|
|
- `userfront/test/locale_registry_test.dart`
|
|
- S7 커버
|