Skip to content

Fix pre-existing test failures in tile provider tests#33

Merged
stopflock merged 2 commits intoFoggedLens:mainfrom
dougborg:pr/01-test-fixes
Feb 7, 2026
Merged

Fix pre-existing test failures in tile provider tests#33
stopflock merged 2 commits intoFoggedLens:mainfrom
dougborg:pr/01-test-fixes

Conversation

@dougborg
Copy link
Collaborator

@dougborg dougborg commented Feb 2, 2026

Stack order: 1/5

Series overview

This is the first in a series of 5 PRs that add static analysis, modernize deprecated APIs, and integrate FlockSquawk RF scanner hardware into DeFlock. The end goal is a live connection between the FlockSquawk ESP32 scanner and the DeFlock app: FlockSquawk passively detects surveillance devices via WiFi/BLE, then streams those detections to DeFlock over USB serial or BLE so users can see real-time RF alerts overlaid on the existing surveillance camera map.

The companion FlockSquawk PR series adds the firmware-side detection engine, BLE GATT server, and M5StickC UI that this app connects to.

PR stack:

  1. PR1 (this) — Fix pre-existing test failures
  2. Add flutter_lints and fix all analyzer warnings #34
  3. Migrate Radio to RadioGroup widget #35
  4. Refactor State methods to use idiomatic mounted/context #36
  5. Add FlockSquawk scanner integration (USB + BLE) #37

Summary

  • Fix failing tile provider unit tests that were broken by upstream API changes
  • Remove obsolete widget_test.dart that referenced non-existent widgets

Test plan

  • Run flutter test and verify all tests pass
  • Verify no regressions in map tile display

🤖 Generated with Claude Code

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes broken unit tests around tile providers (and removes an obsolete generated widget test) to align with current app structure / upstream API behavior.

Changes:

  • Removed test/widget_test.dart which referenced non-existent widgets.
  • Updated DeflockTileProvider tests to use app package imports and to set up AppState.instance for the provider logic.
  • Updated default tile provider tests to account for providers that require API keys being unusable by default.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/widget_test.dart Removes obsolete generated widget smoke test.
test/services/deflock_tile_provider_test.dart Updates tile provider tests to reflect new API requirements and app-state dependency.
test/models/tile_provider_test.dart Fixes package import + updates usability expectations for API-key-requiring providers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dougborg and others added 2 commits February 7, 2026 11:27
- tile_provider_test: Fix stale package:flock_map_app import (now
  deflockapp), correct test assertion for Mapbox requiring API key
- deflock_tile_provider_test: Fix relative imports, replace invalid
  const TileLayer with final, mock AppState.instance for getImage test
- Remove widget_test.dart (default flutter create scaffold, references
  nonexistent MyApp counter widget)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address PR review comments:
- Add mocktail and flutter_test to dev_dependencies in pubspec.yaml
- Add tearDown to reset AppState.instance between tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@stopflock stopflock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will have to see it in action.

@dougborg
Copy link
Collaborator Author

dougborg commented Feb 7, 2026

Yeah there shouldn't be any functional changes here from this PR. Working on the next in the series now - should have something soon with that one updated as well.

@stopflock
Copy link
Collaborator

Yep this is about as low risk as it gets. Merging...

@stopflock stopflock merged commit e559b86 into FoggedLens:main Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants