- 同步商城 H5 登录态与原生 token - 完善商城/原生 tab 切换、动画及返回交互 - 修复七鱼客服键盘避让和状态栏恢复 - 调整开屏跳过按钮与登录入口交互
63 lines
1.3 KiB
Dart
63 lines
1.3 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:jinzhi_flutter_app/features/web/presentation/mall_web_host.dart';
|
|
|
|
void main() {
|
|
test('loading only covers the WebView before its first page', () {
|
|
expect(
|
|
shouldShowMallLoading(
|
|
hasError: false,
|
|
hasDisplayedPage: false,
|
|
progress: 0,
|
|
),
|
|
isTrue,
|
|
);
|
|
expect(
|
|
shouldShowMallLoading(
|
|
hasError: false,
|
|
hasDisplayedPage: true,
|
|
progress: 0,
|
|
),
|
|
isFalse,
|
|
);
|
|
expect(
|
|
shouldShowMallLoading(
|
|
hasError: true,
|
|
hasDisplayedPage: false,
|
|
progress: 0,
|
|
),
|
|
isFalse,
|
|
);
|
|
});
|
|
|
|
test('only Android Qiyu pages reserve keyboard space for the WebView', () {
|
|
expect(
|
|
qiyuWebViewBottomInset(
|
|
isShowingQiyuPage: true,
|
|
platform: TargetPlatform.android,
|
|
keyboardInset: 336,
|
|
isWeb: false,
|
|
),
|
|
336,
|
|
);
|
|
expect(
|
|
qiyuWebViewBottomInset(
|
|
isShowingQiyuPage: false,
|
|
platform: TargetPlatform.android,
|
|
keyboardInset: 336,
|
|
isWeb: false,
|
|
),
|
|
0,
|
|
);
|
|
expect(
|
|
qiyuWebViewBottomInset(
|
|
isShowingQiyuPage: true,
|
|
platform: TargetPlatform.iOS,
|
|
keyboardInset: 336,
|
|
isWeb: false,
|
|
),
|
|
0,
|
|
);
|
|
});
|
|
}
|