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, ); }); }