Repository navigation
test(examples): add end-to-end test for the database CRUD example - #1622
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe database CRUD example now includes a Flutter integration test against a local Supabase instance. The test verifies seeded task reads, filtering, creation, completion, renaming, deletion, and cleanup. Polling helpers handle asynchronous UI updates. The README documents the test flow and command-line configuration, and Sequence Diagram(s)sequenceDiagram
participant IntegrationTest
participant FlutterApp
participant Supabase
IntegrationTest->>Supabase: Initialize local client
IntegrationTest->>FlutterApp: Exercise task UI
FlutterApp->>Supabase: Read and modify tasks
Supabase-->>FlutterApp: Return updated task data
FlutterApp-->>IntegrationTest: Render asserted state
Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)examples/database_crud/pubspec.yamlTraceback (most recent call last): Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
) ## What Adds a full end-to-end integration test for the `database_crud` example, matching the one added for `realtime_room`. It drives the actual app widgets against the local Supabase stack rather than calling the repository directly. ## The test `integration_test/tasks_test.dart` uses `testWidgets` to: 1. Pump `CrudExampleApp` and wait for the seeded tasks to load (select). 2. **Filter** by title through the search field and assert the list narrows, then clears (ilike). 3. **Create** a task through the new-task dialog and assert it appears (insert). 4. **Complete** it by ticking the checkbox in its tile and assert the checkbox becomes checked (update). 5. **Rename** it through the edit dialog and assert the new title replaces the old (update). 6. **Delete** it and assert it leaves the list (delete). Because reads and writes go over the network, the UI can't be settled with `pumpAndSettle`; a small `_pumpUntil` helper polls the widget tree with a timeout instead. The test uses a unique task title and a `tearDown` that removes any `E2E %` rows, so it runs repeatably and leaves the seed data untouched. Also adds the `integration_test` dev dependency and an "Integration test" section to the example README. ## Testing - `flutter analyze`: no issues; `dart format`: clean. - Ran end to end against a local stack, twice, both green. Integration tests need a device, so run it with `-d macos`, an emulator or a real device.
What
Adds a full end-to-end integration test for the
database_crudexample, matching the one added forrealtime_room. It drives the actual app widgets against the local Supabase stack rather than calling the repository directly.The test
integration_test/tasks_test.dartusestestWidgetsto:CrudExampleAppand wait for the seeded tasks to load (select).Because reads and writes go over the network, the UI can't be settled with
pumpAndSettle; a small_pumpUntilhelper polls the widget tree with a timeout instead. The test uses a unique task title and atearDownthat removes anyE2E %rows, so it runs repeatably and leaves the seed data untouched.Also adds the
integration_testdev dependency and an "Integration test" section to the example README.Testing
flutter analyze: no issues;dart format: clean.-d macos, an emulator or a real device.