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
@@ -0,0 +1,72 @@
|
||||
import 'package:cutdex/app/editor_theme.dart';
|
||||
import 'package:cutdex/features/editor/editor_panel_defaults.dart';
|
||||
import 'package:cutdex/features/preview/preview_panel.dart';
|
||||
import 'package:cutdex/l10n/app_localizations.dart';
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('pending preview uses black, zero times and default ratio', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
ProviderScope(
|
||||
child: MaterialApp(
|
||||
theme: EditorTheme.penLight,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
locale: const Locale('en'),
|
||||
home: const Scaffold(
|
||||
body: EditorPreviewPanel(
|
||||
projectId: 'pending-project',
|
||||
timelineId: '',
|
||||
pending: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(find.text('00:00:00:00 / 00:00:00:00'), findsOneWidget);
|
||||
expect(
|
||||
tester
|
||||
.widget<ColoredBox>(find.byKey(const Key('preview-default-frame')))
|
||||
.color,
|
||||
Colors.black,
|
||||
);
|
||||
final ratio = tester.widget<AppSelect<ProjectCanvas>>(
|
||||
find.byType(AppSelect<ProjectCanvas>),
|
||||
);
|
||||
expect(ratio.value, ProjectCanvas.widescreen);
|
||||
expect(ratio.onChanged, isNull);
|
||||
final play = tester.widget<IconButton>(
|
||||
find.widgetWithIcon(IconButton, Icons.play_arrow),
|
||||
);
|
||||
expect(play.onPressed, isNull);
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
|
||||
testWidgets('default timeline has empty content and disabled commands', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: EditorTheme.penLight,
|
||||
home: const Scaffold(body: EditorTimelineDefaults()),
|
||||
),
|
||||
);
|
||||
expect(find.byKey(const Key('timeline-default-tracks')), findsOneWidget);
|
||||
expect(find.byKey(const Key('timeline-toolbar')), findsOneWidget);
|
||||
for (final button in tester.widgetList<IconButton>(
|
||||
find.byType(IconButton),
|
||||
)) {
|
||||
expect(button.onPressed, isNull);
|
||||
}
|
||||
expect(find.byType(CircularProgressIndicator), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user