- 同步商城 H5 登录态与原生 token - 完善商城/原生 tab 切换、动画及返回交互 - 修复七鱼客服键盘避让和状态栏恢复 - 调整开屏跳过按钮与登录入口交互
33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:jinzhi_flutter_app/features/web/application/web_navigation_policy.dart';
|
|
|
|
void main() {
|
|
test('external handoff matches the resident mall policy', () {
|
|
expect(
|
|
shouldOpenWebUrlExternally('https://example.com/download?out=1'),
|
|
isTrue,
|
|
);
|
|
expect(shouldOpenWebUrlExternally('https://example.com/order/1'), isFalse);
|
|
expect(shouldOpenWebUrlExternally('tel:4000450268'), isTrue);
|
|
});
|
|
|
|
test('telephone handoff removes H5 parameters', () {
|
|
expect(
|
|
sanitizeSystemCommunicationUri(Uri.parse('tel:4000450268?out=1')),
|
|
Uri.parse('tel:4000450268'),
|
|
);
|
|
expect(
|
|
sanitizeSystemCommunicationUri(
|
|
Uri.parse('tel:4000450268&campaign=mall&out=1'),
|
|
),
|
|
Uri.parse('tel:4000450268'),
|
|
);
|
|
});
|
|
|
|
test('trusts only exact Qiyu domains and subdomains', () {
|
|
expect(isTrustedQiyuUrl('https://qiyukf.com/client'), isTrue);
|
|
expect(isTrustedQiyuUrl('https://service.qiyukf.cn/client'), isTrue);
|
|
expect(isTrustedQiyuUrl('https://qiyukf.com.evil.example/client'), isFalse);
|
|
});
|
|
}
|