Skip to content

Instantly share code, notes, and snippets.

@toshiossada
Created November 14, 2021 01:22
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