Files
swiftcontrol/test/steering_gauge_test.dart
Jonas Bark 8b19b2ad3f refactor(phone-steering): replace steering-wheel gauge with compact horizontal gauge
Renames SteeringWheelGauge → SteeringGauge and rewrites the painter as a
horizontal bar with a sliding knob and glowing end zones, saving vertical space
on the device card footer. Updates the overview.dart usage and snapshot tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 11:25:42 +02:00

19 lines
704 B
Dart

import 'package:bike_control/widgets/controller/steering_gauge.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('steerSideFor', () {
test('positive angle past threshold ⇒ left (matches _applyPWMSteering)', () {
expect(steerSideFor(8, 5), SteerSide.left);
});
test('negative angle past threshold ⇒ right', () {
expect(steerSideFor(-8, 5), SteerSide.right);
});
test('within threshold ⇒ none', () {
expect(steerSideFor(4, 5), SteerSide.none);
expect(steerSideFor(-5, 5), SteerSide.none); // boundary is inclusive-neutral
expect(steerSideFor(5, 5), SteerSide.none); // positive boundary inclusive-neutral
});
});
}