You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
2 years ago
|
import 'package:nextcloud/nextcloud.dart';
|
||
|
import 'package:test/test.dart';
|
||
|
|
||
|
import 'helper.dart';
|
||
|
|
||
|
Future main() async {
|
||
2 years ago
|
await run(await getDockerImage());
|
||
|
}
|
||
2 years ago
|
|
||
2 years ago
|
Future run(final DockerImage image) async {
|
||
2 years ago
|
group('provisioning_api', () {
|
||
2 years ago
|
late DockerContainer container;
|
||
2 years ago
|
late TestNextcloudClient client;
|
||
2 years ago
|
setUp(() async {
|
||
|
container = await getDockerContainer(image);
|
||
|
client = await getTestClient(container);
|
||
|
});
|
||
|
tearDown(() => container.destroy());
|
||
2 years ago
|
|
||
|
test('Get current user', () async {
|
||
2 years ago
|
final user = await client.provisioningApi.getCurrentUser();
|
||
2 years ago
|
expect(user.ocs.data.id, 'user1');
|
||
|
expect(user.ocs.data.getDisplayName(), 'User One');
|
||
|
expect(user.ocs.data.displaynameScope, 'v2-federated');
|
||
|
expect(user.ocs.data.language, 'en');
|
||
2 years ago
|
});
|
||
|
|
||
|
test('Get user by username', () async {
|
||
2 years ago
|
final user = await client.provisioningApi.getUser(userId: 'user1');
|
||
2 years ago
|
expect(user.ocs.data.id, 'user1');
|
||
|
expect(user.ocs.data.getDisplayName(), 'User One');
|
||
|
expect(user.ocs.data.displaynameScope, 'v2-federated');
|
||
|
expect(user.ocs.data.language, 'en');
|
||
2 years ago
|
});
|
||
|
});
|
||
|
}
|