-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(nextcloud): Add dashboard tests
Signed-off-by: jld3103 <[email protected]>
- Loading branch information
1 parent
f8396ef
commit 9f10d78
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:test/test.dart'; | ||
|
||
import 'helper.dart'; | ||
|
||
void main() { | ||
group( | ||
'dashboard', | ||
() { | ||
late DockerImage image; | ||
setUpAll(() async => image = await getDockerImage()); | ||
|
||
late DockerContainer container; | ||
late TestNextcloudClient client; | ||
setUp(() async { | ||
container = await getDockerContainer(image); | ||
client = await getTestClient(container); | ||
}); | ||
tearDown(() => container.destroy()); | ||
|
||
test('Get widgets', () async { | ||
final response = await client.dashboard.dashboardApi.getWidgets(); | ||
expect(response.ocs.data.keys, equals(['activity', 'notes', 'recommendations', 'user_status'])); | ||
}); | ||
|
||
group('Get widget items', () { | ||
test('v1', () async { | ||
final response = await client.dashboard.dashboardApi.getWidgetItems(); | ||
expect(response.ocs.data.keys, equals(['recommendations'])); | ||
final items = response.ocs.data['recommendations']!; | ||
expect(items, hasLength(7)); | ||
}); | ||
|
||
test('v2', () async { | ||
final response = await client.dashboard.dashboardApi.getWidgetItemsV2(); | ||
expect(response.ocs.data.keys, equals(['recommendations'])); | ||
final items = response.ocs.data['recommendations']!.items; | ||
expect(items, hasLength(7)); | ||
}); | ||
}); | ||
}, | ||
retry: retryCount, | ||
timeout: timeout, | ||
); | ||
} |