Skip to content

Commit

Permalink
Update deep_links_screen_test.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
hannah-hyj committed Apr 11, 2024
1 parent e54fbff commit 8c197ea
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,48 @@ void main() {
},
);

testWidgetsWithWindowSize(
'show scheme or missing scheme',
windowSize,
(WidgetTester tester) async {
final deepLinksController = DeepLinksTestController();

deepLinksController.selectedProject.value =
FlutterProject(path: '/abc', androidVariants: ['debug', 'release']);

final linkDatas = [
LinkData(
domain: 'www.domain1.com',
path: '/',
os: [PlatformOS.android],
),
LinkData(
domain: 'www.domain2.com',
path: '/',
os: [PlatformOS.ios],
scheme: {'http'},
),
];

deepLinksController.validatedLinkDatas = ValidatedLinkDatas(
all: linkDatas,
byDomain: deepLinksController.linkDatasByDomain(linkDatas),
byPath: deepLinksController.linkDatasByPath(linkDatas),
);

await pumpDeepLinkScreen(
tester,
controller: deepLinksController,
);

expect(find.text('www.domain1.com'), findsOneWidget);
expect(find.text('www.domain2.com'), findsOneWidget);

expect(find.text('missing scheme'), findsOneWidget);
expect(find.text('http'), findsOneWidget);
},
);

testWidgetsWithWindowSize(
'path view',
windowSize,
Expand Down

0 comments on commit 8c197ea

Please sign in to comment.