Browse Source

fix(neon_dashboard): Fix matching goldens

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/1106/head
jld3103 1 year ago
parent
commit
86385b1d04
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 24
      packages/neon/neon_dashboard/test/widget_test.dart

24
packages/neon/neon_dashboard/test/widget_test.dart

@ -88,7 +88,7 @@ void main() {
);
expect(find.byType(NeonCachedImage), findsNWidgets(2));
expect(find.byType(DashboardWidgetItem), matchesGoldenFile('goldens/widget_item.png'));
await expectLater(find.byType(DashboardWidgetItem), matchesGoldenFile('goldens/widget_item.png'));
});
testWidgets('Not round', (final tester) async {
@ -111,7 +111,7 @@ void main() {
),
);
expect(find.byType(DashboardWidgetItem), matchesGoldenFile('goldens/widget_item_not_round.png'));
await expectLater(find.byType(DashboardWidgetItem), matchesGoldenFile('goldens/widget_item_not_round.png'));
});
testWidgets('Without link', (final tester) async {
@ -171,7 +171,7 @@ void main() {
expect(find.byIcon(Icons.add), findsOneWidget);
expect(find.text('Button'), findsOneWidget);
expect(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_new.png'));
await expectLater(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_new.png'));
});
testWidgets('More', (final tester) async {
@ -187,7 +187,7 @@ void main() {
expect(find.byIcon(Icons.more_outlined), findsOneWidget);
expect(find.text('Button'), findsOneWidget);
expect(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_more.png'));
await expectLater(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_more.png'));
});
testWidgets('Setup', (final tester) async {
@ -203,7 +203,7 @@ void main() {
expect(find.byIcon(Icons.launch), findsOneWidget);
expect(find.text('Button'), findsOneWidget);
expect(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_setup.png'));
await expectLater(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_setup.png'));
});
testWidgets('Invalid', (final tester) async {
@ -219,7 +219,7 @@ void main() {
expect(find.byType(Icon), findsNothing);
expect(find.text('Button'), findsOneWidget);
expect(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_invalid.png'));
await expectLater(find.byType(DashboardWidgetButton), matchesGoldenFile('goldens/widget_button_invalid.png'));
});
});
@ -295,7 +295,7 @@ void main() {
expect(find.byIcon(Icons.add), findsOneWidget);
expect(find.text('Button'), findsOneWidget);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget.png'));
});
testWidgets('Without widgetUrl', (final tester) async {
@ -339,7 +339,7 @@ void main() {
),
);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_not_round.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_not_round.png'));
});
testWidgets('With halfEmptyContentMessage', (final tester) async {
@ -356,7 +356,7 @@ void main() {
expect(find.text('Half empty'), findsOneWidget);
expect(find.byIcon(Icons.check), findsOneWidget);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_with_half_empty.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_with_half_empty.png'));
});
testWidgets('With emptyContentMessage', (final tester) async {
@ -373,7 +373,7 @@ void main() {
expect(find.text('Empty'), findsOneWidget);
expect(find.byIcon(Icons.check), findsOneWidget);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_with_empty.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_with_empty.png'));
});
testWidgets('Without items', (final tester) async {
@ -390,7 +390,7 @@ void main() {
expect(find.text('No entries'), findsOneWidget);
expect(find.byIcon(Icons.check), findsOneWidget);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_without_items.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_without_items.png'));
});
testWidgets('Without buttons', (final tester) async {
@ -406,7 +406,7 @@ void main() {
expect(find.bySubtype<FilledButton>(), findsNothing);
expect(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_without_buttons.png'));
await expectLater(find.byType(DashboardWidget), matchesGoldenFile('goldens/widget_without_buttons.png'));
});
});
}

Loading…
Cancel
Save