Skip to content

Commit 4247500

Browse files
committed
feat: add fraction and ratio properties to ChannelSettingsDraft in tests
1 parent fb3c9a9 commit 4247500

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

client/test/devices/borneo/lyfi/channel_settings_view_model_test.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,22 @@ void main() {
2222
});
2323

2424
test('draft exposes the same validation rules used by the parent model', () {
25-
const draft = ChannelSettingsDraft(name: 'foo', color: '#112233', wavelength: 450, wavelength2: 450);
26-
const invalidDraft = ChannelSettingsDraft(name: '', color: '#112233', wavelength: 70000, wavelength2: 70000);
25+
const draft = ChannelSettingsDraft(
26+
name: 'foo',
27+
color: '#112233',
28+
wavelength: 450,
29+
wavelength2: 450,
30+
fraction: 1.0,
31+
ratio: 1.0,
32+
);
33+
const invalidDraft = ChannelSettingsDraft(
34+
name: '',
35+
color: '#112233',
36+
wavelength: 70000,
37+
wavelength2: 70000,
38+
fraction: 1.0,
39+
ratio: 1.0,
40+
);
2741

2842
expect(draft.nameValid, isTrue);
2943
expect(draft.wavelengthValid, isTrue);

client/test/devices/borneo/lyfi/dimmer_channel_view_test.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ void main() {
4747
final resultFuture = Navigator.of(navigatorContext!).push<ChannelSettingsDraft>(
4848
MaterialPageRoute(
4949
builder: (_) => const DimmerChannelView(
50-
initialValue: ChannelSettingsDraft(name: 'ch1', color: '#FFFFFF', wavelength: 450, wavelength2: 450),
50+
initialValue: ChannelSettingsDraft(
51+
name: 'ch1',
52+
color: '#FFFFFF',
53+
wavelength: 450,
54+
wavelength2: 450,
55+
fraction: 1.0,
56+
ratio: 1.0,
57+
),
5158
),
5259
),
5360
);
@@ -100,7 +107,14 @@ void main() {
100107
Navigator.of(navigatorContext!).push<void>(
101108
MaterialPageRoute(
102109
builder: (_) => const DimmerChannelView(
103-
initialValue: ChannelSettingsDraft(name: 'ch1', color: '#FFFFFF', wavelength: 450, wavelength2: 450),
110+
initialValue: ChannelSettingsDraft(
111+
name: 'ch1',
112+
color: '#FFFFFF',
113+
wavelength: 450,
114+
wavelength2: 450,
115+
fraction: 1.0,
116+
ratio: 1.0,
117+
),
104118
),
105119
),
106120
);

0 commit comments

Comments
 (0)