refactor(desktop): reorganize workspace panels and navigation
This commit is contained in:
1 parent
826745b407
commit
1f73765745
92 files changed
+5811
-2650
No files matched your search
@@ -349,6 +349,8 @@ void main() {
|
||||
return pending.future;
|
||||
});
|
||||
final loadingRect = tester.getRect(toolbar);
|
||||
expect(find.byKey(const Key('preview-default-frame')), findsOneWidget);
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
expect(find.text('00:00:00:00 / 00:00:00:00'), findsOneWidget);
|
||||
expect(tester.widget<IconButton>(playButton).onPressed, isNull);
|
||||
pending.completeError(StateError('unavailable'));
|
||||
@@ -408,6 +410,76 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('clock and playback update only their own preview regions', (
|
||||
tester,
|
||||
) async {
|
||||
final preview = _Preview();
|
||||
addTearDown(preview.dispose);
|
||||
await mount(tester, () async => preview);
|
||||
await tester.pumpAndSettle();
|
||||
final canvasBefore = tester.widget<PreviewCanvas>(
|
||||
find.byType(PreviewCanvas),
|
||||
);
|
||||
final toolbarBefore = tester.widget(toolbar);
|
||||
final playBefore = tester.widget<IconButton>(playButton);
|
||||
final ratioBefore = tester.widget<AppSelect<ProjectCanvas>>(
|
||||
find.byType(AppSelect<ProjectCanvas>),
|
||||
);
|
||||
final timeFinder = find.descendant(
|
||||
of: find.byKey(const Key('preview-time')),
|
||||
matching: find.byType(Text),
|
||||
);
|
||||
final timeBefore = tester.widget<Text>(timeFinder);
|
||||
|
||||
preview.moveTo(TimelineClock.ticksPerSecond);
|
||||
await tester.pump();
|
||||
expect(find.text('00:00:01:00 / 02:00:00:00'), findsOneWidget);
|
||||
expect(tester.widget(toolbar), same(toolbarBefore));
|
||||
expect(
|
||||
tester.widget<PreviewCanvas>(find.byType(PreviewCanvas)),
|
||||
same(canvasBefore),
|
||||
);
|
||||
expect(tester.widget<IconButton>(playButton), same(playBefore));
|
||||
expect(
|
||||
tester.widget<AppSelect<ProjectCanvas>>(
|
||||
find.byType(AppSelect<ProjectCanvas>),
|
||||
),
|
||||
same(ratioBefore),
|
||||
);
|
||||
expect(tester.widget<Text>(timeFinder), isNot(same(timeBefore)));
|
||||
final timeAfterSeek = tester.widget<Text>(timeFinder);
|
||||
|
||||
await preview.togglePlayback();
|
||||
await tester.pump();
|
||||
expect(find.byIcon(Icons.pause), findsOneWidget);
|
||||
expect(tester.widget(toolbar), same(toolbarBefore));
|
||||
expect(
|
||||
tester.widget<PreviewCanvas>(find.byType(PreviewCanvas)),
|
||||
same(canvasBefore),
|
||||
);
|
||||
expect(tester.widget<Text>(timeFinder), same(timeAfterSeek));
|
||||
expect(
|
||||
tester.widget<AppSelect<ProjectCanvas>>(
|
||||
find.byType(AppSelect<ProjectCanvas>),
|
||||
),
|
||||
same(ratioBefore),
|
||||
);
|
||||
|
||||
preview.setCanvas(
|
||||
ProjectCanvasPresets.values.values.firstWhere(
|
||||
(value) => value != preview.canvas,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
expect(tester.widget(toolbar), same(toolbarBefore));
|
||||
expect(tester.widget<Text>(timeFinder), same(timeAfterSeek));
|
||||
expect(
|
||||
tester.widget<PreviewCanvas>(find.byType(PreviewCanvas)),
|
||||
isNot(same(canvasBefore)),
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('offline media keeps playback available with a local notice', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user