Skip to content

Commit

Permalink
test: add one more saved test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgomesdev committed Apr 27, 2024
1 parent bdef15e commit 000f05d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/feature_saved_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,39 @@ void main() {
findsOne);
});

testWidgets(
'Saving a text of a subcategory should appear '
'in the saved texts screen with the root category', (tester) async {
await startApp(tester);
await openDrawer(tester);

await tester.tap(find.text('Poemas de Alberto Caeiro'));
await tester.pumpAndSettle();
await tester.tap(find.text('POEMAS INCONJUNTOS'));
await tester.pumpAndSettle();

var textFinder = find.text('A criança que pensa em fadas e acredita nas fadas');

await tester.tap(textFinder);
await tester.pumpAndSettle();

await tester.tap(find.byIcon(Icons.bookmark_outline_outlined));
await tester.pumpAndSettle();

expect(find.byIcon(Icons.bookmark_outlined), findsOne);

await openDrawer(tester);

await tester.tap(find.byIcon(Icons.bookmarks));
await tester.pumpAndSettle();

expect(
find.descendant(
of: find.widgetWithText(ExpansionTile, 'Poemas de Alberto Caeiro'),
matching: textFinder),
findsOne);
});

testWidgets(
'Unsaving a text should make it disappear from the saved texts screen',
(tester) async {
Expand Down

0 comments on commit 000f05d

Please sign in to comment.