Skip to content

Commit

Permalink
test(neon): Add test for setting invalid values in SelectOption
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <jld3103yt@gmail.com>
  • Loading branch information
provokateurin committed Nov 2, 2023
1 parent 60315c9 commit ec941c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/neon/neon/test/option_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,21 @@ void main() {
expect(option.values, newValues, reason: 'Should keep the values.');
});

test('Invalid values', () {
expect(option.values, equals(valuesLabel));

option
..value = SelectValues.second
..values = {
SelectValues.first: (final _) => 'first',
SelectValues.third: (final _) => 'third',
};
expect(option.value, SelectValues.first, reason: 'Invalid value.');

option.value = SelectValues.second;
expect(option.value, SelectValues.first, reason: 'Invalid value.');
});

test('Reset', () {
final callback = MockCallbackFunction();
option
Expand Down

0 comments on commit ec941c1

Please sign in to comment.