test: add complete iOS MVP business suite

This commit is contained in:
selfrelease
2026-07-18 20:54:23 +08:00
parent e19bdb8728
commit 24101398d8
11 changed files with 394 additions and 0 deletions
@@ -20,6 +20,14 @@ class AuthSessionController extends AsyncNotifier<AuthSession?> {
@override
Future<AuthSession?> build() async {
if (RuntimeConfig.e2eAccessToken.isNotEmpty) {
return AuthSession(
accessToken: RuntimeConfig.e2eAccessToken,
refreshToken: null,
idToken: null,
expiresAt: DateTime.now().toUtc().add(const Duration(hours: 1)),
);
}
try {
return await _restore();
} catch (_) {
@@ -7,6 +7,11 @@ class RuntimeConfig {
static const _configuredOidcIssuer = String.fromEnvironment(
'AIOA_OIDC_ISSUER',
);
static const e2eAccessToken = String.fromEnvironment('AIOA_E2E_ACCESS_TOKEN');
static const e2eEmployeeToken = String.fromEnvironment(
'AIOA_E2E_EMPLOYEE_TOKEN',
);
static const e2eRole = String.fromEnvironment('AIOA_E2E_ROLE');
static String get apiBaseUrl => _configuredApiBaseUrl.isNotEmpty
? _configuredApiBaseUrl
@@ -98,6 +98,7 @@ class DynamicFormCard extends StatelessWidget {
onChanged: (value) => onChanged(control.field, value),
),
FormControlType.dateTime => _DateTimeControl(
key: ValueKey(control.field),
label: label,
value: state.values[control.field] as String?,
errorText: error,
@@ -109,6 +110,7 @@ class DynamicFormCard extends StatelessWidget {
class _DateTimeControl extends StatelessWidget {
const _DateTimeControl({
super.key,
required this.label,
required this.value,
required this.errorText,