Skip to content

Commit

Permalink
Add test for decoding location with UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Dec 26, 2023
1 parent 9b8ced3 commit 3287925
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/src/state_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,36 @@ void main() => group('state', () {
expect(state.arguments['флаг'], isEmpty);
expect(() => state.location, returnsNormally);
});

test('decode_location_with_uuid', () {
const id = '6e280140-5480-11ed-adf7-7f0a6d7e4482';
const selected = 'about';
const tabs = 'posts';
const location = '/home'
'/production~id=$id&selected=$selected'
'?tabs=$tabs';
final state = OctopusState.fromLocation(location);
expect(state.children, hasLength(2));
expect(state.arguments.keys, hasLength(1));
expect(
state.findByName('production'),
isA<OctopusNode>()
.having(
(e) => e.arguments['id'],
'id',
allOf(
isNotEmpty,
equals(id),
),
)
.having(
(e) => e.arguments['selected'],
'selected',
allOf(
isNotEmpty,
equals(selected),
),
));
expect(state.arguments['tabs'], equals(tabs));
});
});

0 comments on commit 3287925

Please sign in to comment.