feat:餐段设置
This commit is contained in:
1 parent
67950343a7
commit
07a3141934
14 files changed
+285
-18
No files matched your search
@@ -26,6 +26,7 @@ void main() {
|
||||
autoRecognitionEnabled: false,
|
||||
continuousRecognitionEnabled: false,
|
||||
quickVerificationEnabled: false,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (method) => selectedMethod = method,
|
||||
onStart: () => startCalls++,
|
||||
),
|
||||
@@ -47,6 +48,7 @@ void main() {
|
||||
autoRecognitionEnabled: true,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: false,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (method) => selectedMethod = method,
|
||||
onStart: () => startCalls++,
|
||||
),
|
||||
@@ -78,6 +80,7 @@ void main() {
|
||||
autoRecognitionEnabled: true,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: false,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
@@ -100,6 +103,7 @@ void main() {
|
||||
autoRecognitionEnabled: true,
|
||||
continuousRecognitionEnabled: false,
|
||||
quickVerificationEnabled: true,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
@@ -139,6 +143,7 @@ void main() {
|
||||
autoRecognitionEnabled: false,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: true,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
@@ -180,6 +185,7 @@ void main() {
|
||||
autoRecognitionEnabled: false,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: true,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
@@ -205,6 +211,7 @@ void main() {
|
||||
autoRecognitionEnabled: false,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: true,
|
||||
allowManualMealPeriodChange: true,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
@@ -226,6 +233,42 @@ void main() {
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('禁止主动修改餐段时选择器禁用且无法打开餐段菜单', (tester) async {
|
||||
await tester.binding.setSurfaceSize(const Size(1920, 1080));
|
||||
addTearDown(() => tester.binding.setSurfaceSize(null));
|
||||
final mealSlotController = FRadioSelectGroupController<String>(value: '1');
|
||||
addTearDown(mealSlotController.dispose);
|
||||
|
||||
await tester.pumpWidget(
|
||||
_testApp(
|
||||
QueryMethodPanel(
|
||||
methods: ReservationRecognitionMethod.values,
|
||||
selected: ReservationRecognitionMethod.card,
|
||||
status: ReservationMenuQueryStatus.idle,
|
||||
mealSlotController: mealSlotController,
|
||||
autoRecognitionEnabled: false,
|
||||
continuousRecognitionEnabled: true,
|
||||
quickVerificationEnabled: true,
|
||||
allowManualMealPeriodChange: false,
|
||||
onSelect: (_) {},
|
||||
onStart: () {},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final trigger = find.byKey(
|
||||
const ValueKey('reservation-meal-slot-trigger'),
|
||||
);
|
||||
expect(find.text('早餐'), findsOneWidget);
|
||||
expect(tester.widget<FSelectMenuTile<String>>(trigger).enabled, isFalse);
|
||||
|
||||
await tester.tap(trigger);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('meal-slot-option-2')), findsNothing);
|
||||
expect(mealSlotController.value, {'1'});
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
/// 构建与终端设计基准一致的主题和尺寸环境,只验证本组件的可见状态与点击链路。
|
||||
|
||||
Reference in new issue
Block a user