Files
plezy/test/utils/layout_constants_test.dart
T
edde746 4eaf4423a1 refactor: share focus chrome and simplify the TV picker and browse paths
Focus chrome was implemented twice, once in the focusable wrapper and once
in the focus builders; both now go through FocusChrome. TvColorPicker's
channel row was a copy of TvNumberSpinner and is now that widget in compact
density.

Also trims unused helpers and fields and simplifies the Jellyfin browse
paths.
2026-07-26 06:09:49 +02:00

49 lines
1.8 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:plezy/utils/layout_constants.dart';
void main() {
group('ScreenBreakpoints boundaries', () {
test('isMobile: strict < 600', () {
expect(ScreenBreakpoints.isMobile(0), isTrue);
expect(ScreenBreakpoints.isMobile(599.9), isTrue);
expect(ScreenBreakpoints.isMobile(600), isFalse);
});
test('isTablet: 600 ≤ w < 1200', () {
expect(ScreenBreakpoints.isTablet(599.9), isFalse);
expect(ScreenBreakpoints.isTablet(600), isTrue);
expect(ScreenBreakpoints.isTablet(899.9), isTrue);
expect(ScreenBreakpoints.isTablet(900), isTrue);
expect(ScreenBreakpoints.isTablet(1199.9), isTrue);
expect(ScreenBreakpoints.isTablet(1200), isFalse);
});
test('isDesktop: 1200 ≤ w < 1600', () {
expect(ScreenBreakpoints.isDesktop(1199.9), isFalse);
expect(ScreenBreakpoints.isDesktop(1200), isTrue);
expect(ScreenBreakpoints.isDesktop(1599.9), isTrue);
expect(ScreenBreakpoints.isDesktop(1600), isFalse);
});
test('isDesktopOrLarger: w ≥ 1200', () {
expect(ScreenBreakpoints.isDesktopOrLarger(1199.9), isFalse);
expect(ScreenBreakpoints.isDesktopOrLarger(1200), isTrue);
expect(ScreenBreakpoints.isDesktopOrLarger(5000), isTrue);
});
test('isWideTabletOrLarger: w ≥ 900', () {
expect(ScreenBreakpoints.isWideTabletOrLarger(899.9), isFalse);
expect(ScreenBreakpoints.isWideTabletOrLarger(900), isTrue);
expect(ScreenBreakpoints.isWideTabletOrLarger(5000), isTrue);
});
test('constant values match expected thresholds', () {
expect(ScreenBreakpoints.mobile, 600);
expect(ScreenBreakpoints.tablet, 600);
expect(ScreenBreakpoints.wideTablet, 900);
expect(ScreenBreakpoints.desktop, 1200);
expect(ScreenBreakpoints.largeDesktop, 1600);
});
});
}