mirror of
https://github.com/jonasbark/swiftcontrol.git
synced 2026-12-02 10:09:09 +01:00
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>
19 lines
704 B
Dart
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
|
|
});
|
|
});
|
|
}
|