JJ_MKVMaker/test/mkv_landscape_test.dart

32 lines
1.5 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:jj_mkvmaker/app/app_controller.dart';
import 'package:jj_mkvmaker/core/models.dart';
import 'package:jj_mkvmaker/platform/windows/desktop_storage_service.dart';
import 'package:jj_mkvmaker/platform/windows/process_media_tool.dart';
import 'package:jj_mkvmaker/services/platform_services.dart';
import 'package:jj_mkvmaker/ui/home_page.dart';
/// 256: 폰 가로 (노트 10+ 869×411) 의 MKV 화면 - 작업 기록 · 인코딩 줄이 높이를 다 차지해 목록이 한 줄만 보였다
void main() {
testWidgets('256: 폰 가로에서 작업 기록을 켜도 목록이 3줄 넘게 보인다', (tester) async {
tester.view.physicalSize = const Size(869, 411);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final c = AppController(PlatformServices(mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService()));
c.settings.display.showLog = true;
for (var i = 1; i <= 6; i++) {
c.videos.add(VideoItem('D:\\v\\영상$i.mp4'));
}
c.selected = c.videos.first;
await tester.pumpWidget(MaterialApp(home: HomePage(c: c)));
await tester.pump();
expect(tester.takeException(), isNull);
final visible = [
for (var i = 1; i <= 6; i++)
if (find.text('영상$i.mp4').evaluate().isNotEmpty && tester.getRect(find.text('영상$i.mp4').first).bottom <= 411) i,
];
expect(visible.length, greaterThanOrEqualTo(3), reason: '보이는 목록 줄: $visible');
});
}