-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+34.7 KB
forui/test/golden/alert/zinc-dark-Variant.destructive-with-default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.6 KB
forui/test/golden/alert/zinc-dark-Variant.destructive-without-user-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36 KB
forui/test/golden/alert/zinc-dark-Variant.primary-with-default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.9 KB
forui/test/golden/alert/zinc-dark-Variant.primary-without-user-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.2 KB
forui/test/golden/alert/zinc-light-Variant.destructive-with-default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.1 KB
forui/test/golden/alert/zinc-light-Variant.destructive-without-user-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.8 KB
forui/test/golden/alert/zinc-light-Variant.primary-with-default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.7 KB
forui/test/golden/alert/zinc-light-Variant.primary-without-user-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@Tags(['golden']) | ||
library; | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:forui/forui.dart'; | ||
import 'package:forui/src/widgets/alert/alert.dart'; | ||
import '../test_scaffold.dart'; | ||
|
||
void main() { | ||
group('FAlert', () { | ||
for (final (name, theme, _) in TestScaffold.themes) { | ||
for (final variant in Variant.values) { | ||
testWidgets('$name with default icon', (tester) async { | ||
await tester.pumpWidget( | ||
TestScaffold( | ||
data: theme, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: FAlert( | ||
title: const Text('Alert Title'), | ||
subtitle: const Text('Alert description with extra text'), | ||
style: variant, | ||
), | ||
), | ||
), | ||
); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('alert/$name-$variant-with-default-icon.png'), | ||
); | ||
}); | ||
|
||
testWidgets('$name without user icon', (tester) async { | ||
await tester.pumpWidget( | ||
TestScaffold( | ||
data: theme, | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 20), | ||
child: FAlert( | ||
icon: FAssets.icons.badgeAlert, | ||
title: const Text('Alert Title'), | ||
subtitle: const Text('Alert description with extra text'), | ||
style: variant, | ||
), | ||
), | ||
), | ||
); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('alert/$name-$variant-without-user-icon.png'), | ||
); | ||
}); | ||
} | ||
} | ||
}); | ||
} |