mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-10-19 14:50:40 +00:00
8c016e548b
* unified scaffold background color * unified components elevation * use filled tonal icon buttons * aligned slider colors with guidelines * removed unused `CloseButton` * migrated to outlined icons * moved timer list tile to the top of the section * updated goldens * migrated to the latest material utils * reaplced `SchemeTonalSpot` with `SchemeRainbow` * fixed ruler slider ticks color * update goldens * fixed tests * fixed scheme mapping and returned to `SchemeTonalSpot`
61 lines
1.8 KiB
Dart
61 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:lightmeter/generated/l10n.dart';
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/iso_picker/widget_picker_iso.dart';
|
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
|
|
|
import '../../../../../application_mock.dart';
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
Future<void> pumpApplication(
|
|
WidgetTester tester, {
|
|
List<IsoValue> values = IsoValue.values,
|
|
IsoValue selectedValue = const IsoValue(100, StopType.full),
|
|
}) async {
|
|
assert(values.contains(selectedValue));
|
|
await tester.pumpWidget(
|
|
WidgetTestApplicationMock(
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: IsoValuePicker(
|
|
selectedValue: selectedValue,
|
|
values: values,
|
|
onChanged: (_) {},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
}
|
|
|
|
testWidgets(
|
|
'Check dialog icon and title consistency',
|
|
(tester) async {
|
|
await pumpApplication(tester);
|
|
expectReadingValueContainerText(S.current.iso);
|
|
await tester.openAnimatedPicker<IsoValuePicker>();
|
|
expect(find.byIcon(Icons.iso_outlined), findsOneWidget);
|
|
expectDialogPickerText<IsoValue>(S.current.iso);
|
|
expectDialogPickerText<IsoValue>(S.current.filmSpeed);
|
|
},
|
|
);
|
|
|
|
group(
|
|
'Display selected value',
|
|
() {
|
|
testWidgets(
|
|
'Any',
|
|
(tester) async {
|
|
await pumpApplication(tester);
|
|
expectReadingValueContainerText('100');
|
|
await tester.openAnimatedPicker<IsoValuePicker>();
|
|
expectRadioListTile<IsoValue>('100', isSelected: true);
|
|
},
|
|
);
|
|
},
|
|
);
|
|
}
|