-
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
45 changed files
with
314 additions
and
23 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
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
+5.34 KB
forui/test/golden/text_field/default-zinc-light-unfocused-no-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
+5.36 KB
forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
+5.45 KB
forui/test/golden/text_field/multiline-zinc-light-focused-no-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
+5.34 KB
forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Binary file added
BIN
+6.82 KB
forui/test/golden/text_field/password-zinc-dark-unfocused-no-text.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+6.75 KB
forui/test/golden/text_field/password-zinc-light-unfocused-no-text.png
Oops, something went wrong.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
forui/test/src/widgets/switch_test.dart → .../test/src/widgets/switch_golden_test.dart
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
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,133 @@ | ||
@Tags(['golden']) | ||
library; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:forui/forui.dart'; | ||
|
||
import '../test_scaffold.dart'; | ||
|
||
const _text = | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ' | ||
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' | ||
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non ' | ||
'proident, sunt in culpa qui officia deserunt mollit anim id est laborum '; | ||
|
||
void main() { | ||
group('FTextField', () { | ||
for (final (theme, theme_, _) in TestScaffold.themes) { | ||
for (final (focused, focused_) in [('focused', true), ('unfocused', false)]) { | ||
for (final (text, text_) in [('text', _text), ('no-text', null)]) { | ||
testWidgets('default - $theme - $focused', (tester) async { | ||
final controller = text_ == null ? null : TextEditingController(text: text_); | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: TestScaffold( | ||
data: theme_, | ||
child: Padding( | ||
padding: const EdgeInsets.all(20), | ||
child: FTextField( | ||
controller: controller, | ||
autofocus: focused_, | ||
label: 'My Label', | ||
hint: 'hint', | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('text_field/default-$theme-$focused-$text.png'), | ||
); | ||
}); | ||
|
||
testWidgets('email - $theme - $focused', (tester) async { | ||
final controller = text_ == null ? null : TextEditingController(text: text_); | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: TestScaffold( | ||
data: theme_, | ||
child: Padding( | ||
padding: const EdgeInsets.all(20), | ||
child: FTextField.email( | ||
controller: controller, | ||
autofocus: focused_, | ||
label: 'Email', | ||
hint: '[email protected]', | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('text_field/email-$theme-$focused-$text.png'), | ||
); | ||
}); | ||
|
||
testWidgets('password - $theme - $focused', (tester) async { | ||
final controller = text_ == null ? null : TextEditingController(text: text_); | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: TestScaffold( | ||
data: theme_, | ||
child: Padding( | ||
padding: const EdgeInsets.all(20), | ||
child: FTextField.password( | ||
controller: controller, | ||
autofocus: focused_, | ||
label: 'Password', | ||
hint: 'password', | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('text_field/password-$theme-$focused-$text.png'), | ||
); | ||
}); | ||
|
||
testWidgets('multiline - $theme - $focused', (tester) async { | ||
final controller = text_ == null ? null : TextEditingController(text: text_); | ||
await tester.pumpWidget( | ||
MaterialApp( | ||
home: TestScaffold( | ||
data: theme_, | ||
child: Padding( | ||
padding: const EdgeInsets.all(20), | ||
child: FTextField.multiline( | ||
controller: controller, | ||
autofocus: focused_, | ||
label: 'My Label', | ||
hint: 'hint', | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
await tester.pumpAndSettle(); | ||
|
||
await expectLater( | ||
find.byType(TestScaffold), | ||
matchesGoldenFile('text_field/multiline-$theme-$focused-$text.png'), | ||
); | ||
}); | ||
} | ||
|
||
} | ||
} | ||
}); | ||
} |
Oops, something went wrong.