Skip to content

Commit

Permalink
add remove catergory test case
Browse files Browse the repository at this point in the history
  • Loading branch information
MayankJha014 committed Jan 5, 2025
1 parent e771527 commit 1d17720
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,30 @@ void main() {
await tester.tap(find.text('Add Attachments'));
await tester.pumpAndSettle();
});

testWidgets('Remove a selected category', (WidgetTester tester) async {
await tester.pumpWidget(createEditAgendaItemScreen());
await tester.pumpAndSettle();

// Step 1: Select a category
await tester.tap(find.byType(DropdownButtonFormField<AgendaCategory>));
await tester.pumpAndSettle();

await tester.tap(find.text('Category 1').last);
await tester.pumpAndSettle();

// Verify the category was added
expect(find.byKey(const Key('Category 1')), findsOneWidget);

// Step 2: Remove the selected category
await tester.tap(find.byType(DropdownButtonFormField<AgendaCategory>));
await tester.pumpAndSettle();

await tester.tap(find.text('Category 1').last);
await tester.pumpAndSettle();

// Verify the category was removed
expect(find.byKey(const Key('Category 1')), findsNothing);
});
});
}

0 comments on commit 1d17720

Please sign in to comment.