From d0986b3cbb7aa6da7ac3d41121e231a9bab7ccb8 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Mon, 24 Apr 2023 08:42:07 +0200 Subject: [PATCH] nextcloud: migrate tests Signed-off-by: Nikolas Rimikis --- packages/nextcloud/test/core.dart | 5 +++-- packages/nextcloud/test/notes.dart | 7 ++++--- packages/nextcloud/test/notifications.dart | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/nextcloud/test/core.dart b/packages/nextcloud/test/core.dart index 12e52c74..bd53f964 100644 --- a/packages/nextcloud/test/core.dart +++ b/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)); diff --git a/packages/nextcloud/test/notes.dart b/packages/nextcloud/test/notes.dart index 9dcd2f2f..a686899c 100644 --- a/packages/nextcloud/test/notes.dart +++ b/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'); diff --git a/packages/nextcloud/test/notifications.dart b/packages/nextcloud/test/notifications.dart index e3d3a9fa..414709f1 100644 --- a/packages/nextcloud/test/notifications.dart +++ b/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)); });