feat: type stats and event log models
This commit is contained in:
@@ -205,7 +205,9 @@ void main() {
|
||||
|
||||
final state = container.read(statsProvider);
|
||||
expect(state.status, LoadStatus.data);
|
||||
expect(state.data['groups'], hasLength(1));
|
||||
expect(state.data.groups, hasLength(1));
|
||||
expect(state.data.groups.single.targetId, 'kitchen');
|
||||
expect(state.data.groups.single.totalCommands, 3);
|
||||
expect(api.requestedDays, 14);
|
||||
});
|
||||
|
||||
@@ -337,7 +339,7 @@ void main() {
|
||||
|
||||
final state = container.read(statsProvider);
|
||||
expect(state.status, LoadStatus.empty);
|
||||
expect(state.data['groups'], isEmpty);
|
||||
expect(state.data.groups, isEmpty);
|
||||
});
|
||||
|
||||
test('event log load accepts map response and exposes data state', () async {
|
||||
@@ -355,6 +357,8 @@ void main() {
|
||||
final state = container.read(eventLogProvider);
|
||||
expect(state.status, LoadStatus.data);
|
||||
expect(state.data, hasLength(1));
|
||||
expect(state.data.single.action, 'toggle');
|
||||
expect(state.data.single.targetId, 'kitchen');
|
||||
expect(api.requestedLimit, 50);
|
||||
});
|
||||
|
||||
@@ -504,7 +508,7 @@ void main() {
|
||||
|
||||
final state = container.read(statsProvider);
|
||||
expect(state.status, LoadStatus.error);
|
||||
expect(state.data['groups'], hasLength(1));
|
||||
expect(state.data.groups, hasLength(1));
|
||||
expect(state.errorMessage, contains('Backend недоступен'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user