Browse Source

nextcloud: migrate tests

Signed-off-by: Nikolas Rimikis <rimikis.nikolas@gmail.com>
pull/194/head
Nikolas Rimikis 2 years ago
parent
commit
d0986b3cbb
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 5
      packages/nextcloud/test/core.dart
  2. 7
      packages/nextcloud/test/notes.dart
  3. 8
      packages/nextcloud/test/notifications.dart

5
packages/nextcloud/test/core.dart

@ -1,3 +1,4 @@
import 'package:built_collection/built_collection.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart';
@ -67,10 +68,10 @@ Future run(final DockerImage image) async {
search: '',
itemType: 'call',
itemId: 'new',
shareTypes: [
shareTypes: BuiltList([
ShareType.user.code,
ShareType.group.code,
],
]),
);
expect(response.ocs.data, hasLength(3));

7
packages/nextcloud/test/notes.dart

@ -122,9 +122,10 @@ Future run(final DockerImage image) async {
test('Update settings', () async {
var response = await client.notes.updateSettings(
notesSettings: NextcloudNotesSettings(
notesPath: 'Test Notes',
fileSuffix: '.txt',
noteMode: NextcloudNotesSettings_NoteMode.preview,
(final b) => b
..notesPath = 'Test Notes'
..fileSuffix = '.txt'
..noteMode = NextcloudNotesSettings_NoteMode.preview,
),
);
expect(response.notesPath, 'Test Notes');

8
packages/nextcloud/test/notifications.dart

@ -51,9 +51,9 @@ Future run(final DockerImage image) async {
expect(response.ocs.data[0].message, '456');
expect(response.ocs.data[0].link, '');
expect(response.ocs.data[0].subjectRich, '');
expect(response.ocs.data[0].subjectRichParameters, isEmpty);
expect(response.ocs.data[0].subjectRichParameters?.asList, isEmpty);
expect(response.ocs.data[0].messageRich, '');
expect(response.ocs.data[0].messageRichParameters, isEmpty);
expect(response.ocs.data[0].messageRichParameters?.asList, isEmpty);
expect(response.ocs.data[0].icon, isNotEmpty);
expect(response.ocs.data[0].actions, hasLength(0));
});
@ -73,9 +73,9 @@ Future run(final DockerImage image) async {
expect(response.ocs.data.message, '456');
expect(response.ocs.data.link, '');
expect(response.ocs.data.subjectRich, '');
expect(response.ocs.data.subjectRichParameters, isEmpty);
expect(response.ocs.data.subjectRichParameters?.asList, isEmpty);
expect(response.ocs.data.messageRich, '');
expect(response.ocs.data.messageRichParameters, isEmpty);
expect(response.ocs.data.messageRichParameters?.asList, isEmpty);
expect(response.ocs.data.icon, isNotEmpty);
expect(response.ocs.data.actions, hasLength(0));
});

Loading…
Cancel
Save