arc/hesabixUI/hesabix_ui/test/settings_hub_metrics_test.dart
Babak Alizadeh 2b5c6a2498
Some checks failed
Flutter Windows / verify-windows (push) Has been cancelled
fix(ui): densify the business settings hub
Reuse the compact theme-token pattern from the side nav so the settings catalog uses less vertical space without changing which items appear.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 19:40:19 +03:30

40 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hesabix_ui/theme/tokens/settings_hub.dart';
void main() {
const hub = AppSettingsHubMetrics();
test('uses a 1/2/3 column grid by window width', () {
expect(hub.gridColumns(767), 1);
expect(hub.gridColumns(768), 2);
expect(hub.gridColumns(1199), 2);
expect(hub.gridColumns(1200), 3);
});
test('treats 900px as the wide desktop density breakpoint', () {
expect(hub.isWide(899), isFalse);
expect(hub.isWide(900), isTrue);
expect(hub.pagePaddingFor(900), hub.pagePadding);
expect(hub.pagePaddingFor(800), hub.pagePaddingNarrow);
});
test('keeps card copy to a single dense line', () {
expect(hub.cardTitleMaxLines, 1);
expect(hub.cardSubtitleMaxLines, 1);
expect(hub.categorySubtitleMaxLines, 1);
expect(hub.cardTitleFontSize, 13);
expect(hub.cardSubtitleFontSize, 11);
expect(hub.pageTitleFontSize, 18);
});
test('copyWith and lerp preserve the dense defaults', () {
final copied = hub.copyWith(cardTitleFontSize: 12);
expect(copied.cardTitleFontSize, 12);
expect(copied.cardSubtitleFontSize, hub.cardSubtitleFontSize);
final lerped = hub.lerp(copied, 1.0);
expect(lerped, isA<AppSettingsHubMetrics>());
expect((lerped as AppSettingsHubMetrics).cardTitleFontSize, 12);
});
}