[TEST-UI-03] Automated UI/Widget Testing of the Mobile Application

Testing: Frontend

Published

October 14, 2026

NoteTask Brief
  • Component: food_tracker_mobile (Flutter).
  • Tools: Flutter Widget Tests, mockito / bloc_test.
  • Task Type: Frontend QA.
  • Status: Under Analysis

Task Description

It is necessary to cover the UI components of the “Fridge” and “Product Ingestion” screens with tests to verify the reactive behavior of the interface when receiving asynchronous data streams.

Step-by-Step Instructions

  1. Testing WebSocket Events (bloc_test): Write an integration test for FridgeBloc. Verify that when a PRODUCTS_PROCESSED event is pushed into the WebSocket stream, the bloc emits a background update state, and the product list on the screen redraws smoothly without a full page reload.
  2. Widget Testing for Error Modals: Write isolated tests for the AppErrorBottomSheet widget. Pass different gRPC error codes into the widget independently:
    • Verify that when passing code: 16, the screen accurately renders the <i class="bi-lock-fill"></i> icon and the “Refresh Session” button.
    • Verify that when passing code: 14, the text dynamically updates to “Connection Issues”.
  3. Spinner State Testing (Loading State): Ensure that while a receipt is being uploaded, the action button transitions to a disabled state and is replaced by a loading indicator spinner, protecting the system against accidental double-clicks by the user.