Files
swiftcontrol/test/onboarding_grid_uniformity_test.dart
Jonas Bark c6a32a7284 fix(onboarding): step 1/2 design fidelity, Pro-aware done-step help
App picker rebuilt to the design: white tiles with a 1.5px blue active
border and top-right check dot, dark semibold captions with proper
spacing, uppercase hairline group labels with the green VERIFIED badge,
and the info note strip with icon + brand wash (new OnboardingNote,
shared with step 2). Where-step cards rebuilt the same way (blue icon
square + check dot + tinted implies-strip when selected, pencil note).
SelectableCard is no longer used by the wizard — settings pages keep it
unchanged. Help sheet's done-step Q&A no longer talks about test-mode
limits when the user has purchased.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 10:03:30 +02:00

45 lines
1.6 KiB
Dart

// The app-picker tiles must be pixel-identical in size: the visible card
// (SelectableCard's inner Button) has to fill its uniform GridView cell
// instead of shrink-wrapping its caption (1-line vs 2-line captions and the
// selected state previously produced uneven tiles).
import 'package:bike_control/pages/onboarding/steps/step_app.dart' show OnboardingAppTile, onboardingAppBody;
import 'package:bike_control/utils/keymap/apps/supported_app.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'widget_snapshot.dart';
Future<void> main() async {
await ensureSnapshotHarness();
Future<void> expectUniformTiles(WidgetTester tester, {required double width}) async {
await captureWidget(
tester,
name: 'onboarding_step_app_uniform_$width',
width: width,
builder: (c) => onboardingAppBody(
c,
selected: SupportedApp.supportedApps.first,
onSelect: (_) {},
),
);
final cards = find.byType(OnboardingAppTile);
expect(cards, findsWidgets);
final sizes = <Size>{};
for (final card in cards.evaluate()) {
sizes.add(tester.getSize(find.byWidget(card.widget)));
}
expect(sizes, hasLength(1),
reason: 'visible tile cards must all be the same size at width $width, got: $sizes');
}
testWidgets('app grid tiles are uniform (3 columns)', (tester) async {
await expectUniformTiles(tester, width: 380);
});
testWidgets('app grid tiles are uniform (5 columns)', (tester) async {
await expectUniformTiles(tester, width: 640);
});
}