Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions test/packages/service/dfx/models/aggregate_dtos_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ void main() {
expect(dto.realUnitUserDataDto, isNotNull);
});

test('parses NewRegistration with null userData (first-time user → empty form)', () {
final dto = RealUnitRegistrationInfoDto.fromJson({
'state': 'NewRegistration',
'userData': null,
});

expect(dto.state, RealUnitRegistrationState.newRegistration);
expect(dto.realUnitUserDataDto, isNull);
});

test('throws ArgumentError on unknown state', () {
expect(
() => RealUnitRegistrationInfoDto.fromJson({
Expand Down
Loading