mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-06 15:54:27 +01:00
Breakpoints/WindowSize (compact < 600 < medium < 840 < expanded) replace the scattered width literals. The app's existing layout switches keep their exact widths as named constants (twoPane 800, networkValueColumn 640, keymapSideBySide 860, onboarding app grid 560, Click v2 380) so no layout moves. The desktop main window gets a 360x560 minimum size. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
28 lines
1.1 KiB
Dart
28 lines
1.1 KiB
Dart
import 'package:bike_control/utils/window_size.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test('size classes split at 600 and 840', () {
|
|
expect(WindowSize.fromWidth(390), WindowSize.compact);
|
|
expect(WindowSize.fromWidth(599.9), WindowSize.compact);
|
|
expect(WindowSize.fromWidth(600), WindowSize.medium);
|
|
expect(WindowSize.fromWidth(839.9), WindowSize.medium);
|
|
expect(WindowSize.fromWidth(840), WindowSize.expanded);
|
|
});
|
|
|
|
test('legacy layout switches keep their exact widths', () {
|
|
// Moving any of these onto a size-class edge would change a layout
|
|
// riders already use at that width.
|
|
expect(Breakpoints.twoPane, 800);
|
|
expect(Breakpoints.networkValueColumn, 640);
|
|
expect(Breakpoints.keymapSideBySide, 860);
|
|
expect(Breakpoints.onboardingAppGridWide, 560);
|
|
expect(Breakpoints.clickV2Narrow, 380);
|
|
});
|
|
|
|
test('the desktop minimum window still fits the compact layout', () {
|
|
expect(Breakpoints.minDesktopWindow.width, lessThan(Breakpoints.compact));
|
|
expect(Breakpoints.minDesktopWindow.width, greaterThanOrEqualTo(360));
|
|
});
|
|
}
|