fix(flutter): analyze errors after Plan C provider migrations

- cache_first.dart: backtick-fence List<T> doc comment to dodge
  unintended_html_in_doc_comment.
- library_providers.dart:163: switch single-row insert to
  insertAllOnConflictUpdate; Batch only exposes the *AllOnConflict*
  variant.
- 5 test files: StreamProvider.overrideWith takes Create<Stream<T>>,
  not Create<Future<T>>. Wrap data emissions in Stream.value(...).
- artist_detail_screen_test: add models/album.dart import for AlbumRef
  type annotation.
- track_actions_sheet_test: drop _StubLiked extends LikedIdsController
  (notifier no longer exists post-migration); override with
  Stream.value(LikedIds(...)) instead.
- like_button_test: rollback assertion now requires drift writes via
  LikesController. Skip under _skipDrift until libsqlite3-dev lands on
  the runner image (Fable #399). Replace stale .notifier reference
  with likesControllerProvider for completeness.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 13:04:27 -04:00
parent 98fdd9dcdf
commit 94727f40bb
8 changed files with 28 additions and 27 deletions
@@ -12,12 +12,12 @@ void main() {
testWidgets('renders album header + track list', (tester) async {
await tester.pumpWidget(ProviderScope(
overrides: [
albumProvider('al-1').overrideWith((ref) async => (
albumProvider('al-1').overrideWith((ref) => Stream.value((
album: const AlbumRef(id: 'al-1', title: 'Drukqs', artistId: 'a-1', artistName: 'Aphex Twin'),
tracks: const [
TrackRef(id: 't-1', title: 'Avril 14th', albumId: 'al-1', artistId: 'a-1', durationSec: 121, trackNumber: 4),
],
)),
))),
],
child: MaterialApp(theme: buildThemeData(), home: const AlbumDetailScreen(id: 'al-1')),
));
@@ -4,6 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:minstrel/library/artist_detail_screen.dart';
import 'package:minstrel/library/library_providers.dart';
import 'package:minstrel/models/album.dart';
import 'package:minstrel/models/artist.dart';
import 'package:minstrel/theme/theme_data.dart';
@@ -11,8 +12,8 @@ void main() {
testWidgets('renders artist name and Albums header', (tester) async {
await tester.pumpWidget(ProviderScope(
overrides: [
artistProvider('a-1').overrideWith((ref) async => const ArtistRef(id: 'a-1', name: 'Aphex Twin')),
artistAlbumsProvider('a-1').overrideWith((ref) async => const []),
artistProvider('a-1').overrideWith((ref) => Stream.value(const ArtistRef(id: 'a-1', name: 'Aphex Twin'))),
artistAlbumsProvider('a-1').overrideWith((ref) => Stream.value(const <AlbumRef>[])),
],
child: MaterialApp(theme: buildThemeData(), home: const ArtistDetailScreen(id: 'a-1')),
));
@@ -28,7 +28,7 @@ void main() {
overrides: [
homeProvider.overrideWith((ref) async => _emptyHome),
playlistsListProvider('all').overrideWith(
(ref) async => PlaylistsList.empty(),
(ref) => Stream.value(PlaylistsList.empty()),
),
systemPlaylistsStatusProvider.overrideWith(
(ref) async => SystemPlaylistsStatus.empty(),
@@ -48,7 +48,7 @@ void main() {
overrides: [
homeProvider.overrideWith((ref) async => _emptyHome),
playlistsListProvider('all').overrideWith(
(ref) async => PlaylistsList.empty(),
(ref) => Stream.value(PlaylistsList.empty()),
),
systemPlaylistsStatusProvider.overrideWith(
(ref) async => SystemPlaylistsStatus.empty(),
@@ -89,8 +89,8 @@ void main() {
overrides: [
homeProvider.overrideWith((ref) async => _emptyHome),
playlistsListProvider('all').overrideWith(
(ref) async =>
const PlaylistsList(owned: [forYou], public: []),
(ref) => Stream.value(
const PlaylistsList(owned: [forYou], public: [])),
),
systemPlaylistsStatusProvider.overrideWith(
(ref) async => SystemPlaylistsStatus.empty(),
@@ -120,7 +120,7 @@ void main() {
overrides: [
homeProvider.overrideWith((ref) async => home),
playlistsListProvider('all').overrideWith(
(ref) async => PlaylistsList.empty(),
(ref) => Stream.value(PlaylistsList.empty()),
),
systemPlaylistsStatusProvider.overrideWith(
(ref) async => SystemPlaylistsStatus.empty(),