27 lines
1.4 KiB
Dart
27 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:jj_mkvmaker/core/playlist.dart';
|
|
import 'package:jj_mkvmaker/services/media_player.dart';
|
|
import 'package:jj_mkvmaker/ui/audio_now_playing.dart';
|
|
|
|
/// 181 · 182: 소리 파일 (mp3) 재생
|
|
void main() {
|
|
test('181: mp3 는 소리 파일 - 탐색기 [재생] 이 강조한 mp3 를 튼다 (동영상이 아니라고 빼지 않음)', () {
|
|
expect([isAudioFile(r'D:\m\song.mp3'), isVideoFile(r'D:\m\song.mp3')], [true, false]);
|
|
});
|
|
|
|
testWidgets('182: 소리 파일은 검은 화면 대신 제목 · 앨범 그림 (없으면 음표) · 재생 위치', (tester) async {
|
|
final state = ValueNotifier(const PlayerState(position: Duration(seconds: 83), duration: Duration(minutes: 4, seconds: 56)));
|
|
await tester.pumpWidget(MaterialApp(
|
|
home: Scaffold(body: AudioNowPlaying(file: r'D:\m\내 노래.mp3', state: state, cover: Future.value(null))),
|
|
));
|
|
await tester.pump();
|
|
expect(find.text('내 노래'), findsOneWidget);
|
|
expect(find.text('1:23 / 4:56'), findsOneWidget);
|
|
expect(find.byIcon(Icons.music_note), findsOneWidget);
|
|
state.value = const PlayerState(position: Duration(seconds: 84), duration: Duration(minutes: 4, seconds: 56));
|
|
await tester.pump();
|
|
expect(find.text('1:24 / 4:56'), findsOneWidget, reason: '재생 위치가 따라 바뀐다');
|
|
});
|
|
}
|