/widget_goldern.dart Secret
Created
November 14, 2021 01:22
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
import 'package:golden_toolkit/golden_toolkit.dart'; | |
import 'package:goldentest/widgets/custom_textbox_widget.dart'; | |
void main() { | |
testGoldens('Password Input', (tester) async { | |
//arrange | |
await loadAppFonts(); | |
final builder = GoldenBuilder.grid( | |
columns: 2, | |
widthToHeightRatio: 1, | |
) | |
..addScenario( | |
"Password Empty", | |
const CustomTextWidget(obscureText: true), | |
) | |
..addScenario( | |
"Password Hided", | |
const CustomTextWidget(obscureText: true, initialValue: 'Teste'), | |
) | |
..addScenario( | |
"Password Showed", | |
const CustomTextWidget(obscureText: false, initialValue: 'Teste'), | |
); | |
//act | |
await tester.pumpWidgetBuilder(builder.build()); | |
//assert | |
await screenMatchesGolden(tester, 'password-input'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment