refactor(desktop): reorganize workspace panels and navigation
Gitea CI / Windows x64 and Android (pull_request) Successful in 16m21s
Gitea CI / Gitea CI passed (pull_request) Successful in 3s

This commit is contained in:
lingjhf committed 2026-10-06 12:11:59 +08:00
1 parent 826745b407
commit 1f73765745
92 files changed
+5811 -2650

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
import 'package:cutdex/shared/widgets/workspace_card.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets(
'content replacement preserves the card frame and updates theme',
(tester) async {
Widget card(String content, Brightness brightness) => MaterialApp(
theme: ThemeData(brightness: brightness),
home: Scaffold(body: WorkspaceCard(child: Text(content))),
);
final frame = find
.descendant(
of: find.byType(WorkspaceCard),
matching: find.byType(DecoratedBox),
)
.first;
await tester.pumpWidget(card('Project A', Brightness.light));
final before = tester.widget<DecoratedBox>(frame);
final frameElement = tester.element(frame);
await tester.pumpWidget(card('Project B', Brightness.light));
expect(find.text('Project A'), findsNothing);
expect(find.text('Project B'), findsOneWidget);
expect(tester.element(frame), same(frameElement));
expect(tester.widget<DecoratedBox>(frame), same(before));
await tester.pumpWidget(card('Project B', Brightness.dark));
await tester.pumpAndSettle();
expect(tester.element(frame), same(frameElement));
expect(
(tester.widget<DecoratedBox>(frame).decoration as BoxDecoration).color,
isNot((before.decoration as BoxDecoration).color),
);
},
);
}