6ec7cea362
Headers carry placeholder play buttons (wired in Task 18) + room for LikeButton (Task 16). Artist screen has a 2-column album grid; album screen has a track list with mm:ss durations. Routes :id-parameterized under the shell so the PlayerBar persists.
29 lines
1.1 KiB
Dart
29 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:minstrel/library/album_detail_screen.dart';
|
|
import 'package:minstrel/library/library_providers.dart';
|
|
import 'package:minstrel/models/album.dart';
|
|
import 'package:minstrel/models/track.dart';
|
|
import 'package:minstrel/theme/theme_data.dart';
|
|
|
|
void main() {
|
|
testWidgets('renders album header + track list', (tester) async {
|
|
await tester.pumpWidget(ProviderScope(
|
|
overrides: [
|
|
albumProvider('al-1').overrideWith((ref) async => (
|
|
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')),
|
|
));
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('Drukqs'), findsOneWidget);
|
|
expect(find.text('Avril 14th'), findsOneWidget);
|
|
});
|
|
}
|