Skip to content

test: fix pre-existing failing test suites (route/cache goldens, xray_control_deck, di_container_override) #256

Description

@arrrrny

Summary

Multiple test suites are failing on the development branch after the pure-Dart split (#253 / PR #254). These failures are pre-existing — they exist on the PR head independently of the review fixes (PR #255). They block a green dart test / flutter test run and should be fixed.

Failing suites

1. test/dda/route_golden_test.dart — RouteParams generator emits invalid Dart (5 tests)

Failing tests:
  Golden: Track 6.1 — @Route DDA Plugin acceptance: multiple routes produce complete GoRouter configuration
  Golden: Track 6.1 — @Route DDA Plugin generator: multiple path params generate all fields
  Golden: Track 6.1 — @Route DDA Plugin golden: path parameter :id generates RouteParams class
  Golden: Track 6.1 — @Route DDA Plugin golden: query parameters included in RouteParams
  Golden: Track 6.1 — @Route DDA Plugin golden: route name is preserved

Root cause: the generated RouteParams private constructor emits required modifiers inside a positional optional-parameter list:

ProductDetailViewRouteParams._([required this.id, required this.pathParameters, ...])

required is invalid in an optional positional parameter list ([...]) — the formatter rejects it ("Can't have modifier 'required' here"). The generator (lib/src/dda/plugins/route/route_generator.dart, _routeParamsClass) should use named parameters ({...}) or drop required.

2. zuraffa_flutter/test/presentation/xray/xray_control_deck_test.dart — widget test layout/assertion failures (7 tests)

Failing tests:
  XRayControlDeck Widget Tests color mapping for XRayMockType.error
  XRayControlDeck Widget Tests color mapping for XRayMockType.unknown
  XRayControlDeck Widget Tests color mapping for XRayMockType.valid
  XRayControlDeck Widget Tests empty state shows helpful message
  ... and 3 more

Symptoms: tap() derives an offset outside the render tree (Offset(-76.1, -26.0) vs root Size(800.0, 600.0)); find.text("❌") finds 0 widgets. Likely a test-layout/viewport issue in the control deck test harness (e.g. missing Scaffold/sizing, or a widget that renders off-screen at the default test size).

3. test/core/module/di_container_override_test.dartregisterSingleton replaces with override: true (1 test)

Symptom: Error while creating double from get_it / mocktail when di.get() resolves the overridden singleton. Likely a mocktail/get_it interaction or a registration-order issue in ZuraffaDIContainer.registerSingleton(override: true).

4. test/dda/cache_golden_test.dart — Cacheable DDA generator (6 tests)

Failing tests:
  Golden: Track 6.2 — @Cacheable DDA Plugin acceptance: mixed @Cacheable + @CacheInvalidate produce complete file
  Golden: Track 6.2 — @Cacheable DDA Plugin generator: direct CacheGenerator produces valid output
  Golden: Track 6.2 — @Cacheable DDA Plugin golden: @Cacheable on method collects entry
  Golden: Track 6.2 — @Cacheable DDA Plugin golden: TTL check skips expired entries
  ... and 2 more

Same class of generator-golden failures as #1 — likely invalid generated Dart or changed template output.

Acceptance criteria

  • dart test test/dda/route_golden_test.dart passes (5/5)
  • dart test test/dda/cache_golden_test.dart passes (6/6)
  • dart test test/core/module/di_container_override_test.dart passes (1/1)
  • cd zuraffa_flutter && flutter test test/presentation/xray/xray_control_deck_test.dart passes (7/7)
  • Full dart test (core) + flutter test (zuraffa_flutter) are green

Notes

  • These are tracked separately from PR fix: address review comments on #254 #255 (fix: address review comments on #254) which fixes the API-parity/regression review comments — it does not touch these failing suites.
  • The zuraffa_flutter control-deck failures were previously unobservable: the package could not resolve dependencies on the PR head (mata pubspec typo + analyzer conflict), fixed in fix: address review comments on #254 #255.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions