mirror of
https://github.com/ubuntu/yaru_test.dart.git
synced 2025-10-26 12:04:43 +01:00
No description
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|---|---|---|
| .github | ||
| assets | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| analysis_options.yaml | ||
| CHANGELOG.md | ||
| codecov.yaml | ||
| LICENSE | ||
| pubspec.yaml | ||
| README.md | ||
Yaru Test
Provides extensions for testing Yaru Flutter applications.
Usage
dev_dependencies:
yaru_test: <version>
import 'package:yaru_test/yaru_test.dart';
Before
final button = find.widgetWithText(OutlinedButton, ...);
expect(tester.widget<OutlinedButton>(button).enabled, isTrue);
final checkButton = find.widgetWithText(YaruCheckButton...);
expect(tester.widget<YaruCheckButton>(checkButton).value, isTrue);
final listTile = find.widgetWithText(ListTile, ...);
expect(tester.widget<ListTile>(listTile).onTap, isNull);
final textField = find.widgetWithText(TextField, ...);
expect(tester.widget<TextField>(textField).focusNode?.hasFocus, isTrue);
After
expect(find.button(...), isEnabled);
expect(find.checkButton(...), isChecked);
expect(find.listTile(...), isDisabled);
expect(find.radioButton<T>(...), isChecked);
expect(find.textField(...), hasFocus);