Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
66 lines
2.2 KiB
Dart
66 lines
2.2 KiB
Dart
import 'package:cutdex/features/timeline/timeline_ruler_previews.dart';
|
|
import 'package:cutdex_timeline_ui/cutdex_timeline_ui.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
for (final (layout, light, dark, frames) in [
|
|
(
|
|
TimelineRulerTimecodeLayout.inline,
|
|
timecodeRulerLightPreview,
|
|
timecodeRulerDarkPreview,
|
|
timecodeRulerFramePreview,
|
|
),
|
|
(
|
|
TimelineRulerTimecodeLayout.centered,
|
|
centeredTimecodeRulerLightPreview,
|
|
centeredTimecodeRulerDarkPreview,
|
|
centeredTimecodeRulerFramePreview,
|
|
),
|
|
(
|
|
TimelineRulerTimecodeLayout.overlay,
|
|
overlayTimecodeRulerLightPreview,
|
|
overlayTimecodeRulerDarkPreview,
|
|
overlayTimecodeRulerFramePreview,
|
|
),
|
|
]) {
|
|
testWidgets('${layout.name} previews render and zoom at both widths', (
|
|
tester,
|
|
) async {
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
|
|
try {
|
|
tester.view.devicePixelRatio = 1;
|
|
addTearDown(tester.view.resetDevicePixelRatio);
|
|
addTearDown(tester.view.resetPhysicalSize);
|
|
for (final (width, factory) in [
|
|
(640.0, light),
|
|
(640.0, dark),
|
|
(640.0, frames),
|
|
(320.0, dark),
|
|
]) {
|
|
// Remount to give each configuration its own camera state.
|
|
await tester.pumpWidget(const SizedBox.shrink());
|
|
tester.view.physicalSize = Size(width, 152);
|
|
await tester.pumpWidget(factory());
|
|
await tester.pump();
|
|
final ruler = tester.widget<TimelineRuler>(
|
|
find.byType(TimelineRuler),
|
|
);
|
|
expect(ruler.style, TimelineRulerStyle.timecode);
|
|
expect(ruler.timecodeLayout, layout);
|
|
expect(tester.takeException(), isNull);
|
|
final before = ruler.controller.camera.pixelsPerTick;
|
|
await tester.tap(find.byTooltip('Zoom in'));
|
|
await tester.pump();
|
|
expect(ruler.controller.camera.pixelsPerTick, greaterThan(before));
|
|
expect(tester.takeException(), isNull);
|
|
}
|
|
await tester.pumpWidget(const SizedBox.shrink());
|
|
} finally {
|
|
debugDefaultTargetPlatformOverride = null;
|
|
}
|
|
});
|
|
}
|
|
}
|