From 482e4a26c9f4b0110d0312478661ab552fe6b237 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 29 Dec 2022 11:06:53 +0100 Subject: [PATCH] fix graph unit tests Signed-off-by: jkoberg --- services/graph/pkg/service/v0/drives_test.go | 2 +- services/graph/pkg/service/v0/graph_test.go | 10 +++++----- services/graph/pkg/service/v0/password_test.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/graph/pkg/service/v0/drives_test.go b/services/graph/pkg/service/v0/drives_test.go index 7cd084036..28bcb7cf5 100644 --- a/services/graph/pkg/service/v0/drives_test.go +++ b/services/graph/pkg/service/v0/drives_test.go @@ -111,7 +111,7 @@ var sortTests = []sortTest{ } func drive(ID string, dType string, name string, lastModified *time.Time) *libregraph.Drive { - return &libregraph.Drive{Id: libregraph.PtrString(ID), DriveType: libregraph.PtrString(dType), Name: libregraph.PtrString(name), LastModifiedDateTime: lastModified} + return &libregraph.Drive{Id: libregraph.PtrString(ID), DriveType: libregraph.PtrString(dType), Name: name, LastModifiedDateTime: lastModified} } // TestSort tests the available orderby queries diff --git a/services/graph/pkg/service/v0/graph_test.go b/services/graph/pkg/service/v0/graph_test.go index a7bc51a07..f5cf00909 100644 --- a/services/graph/pkg/service/v0/graph_test.go +++ b/services/graph/pkg/service/v0/graph_test.go @@ -292,7 +292,7 @@ var _ = Describe("Graph", func() { Expect(*value.DriveAlias).To(Equal("mountpoint/new-folder")) Expect(*value.DriveType).To(Equal("mountpoint")) Expect(*value.Id).To(Equal("prID$aID!differentID")) - Expect(*value.Name).To(Equal("New Folder")) + Expect(value.Name).To(Equal("New Folder")) Expect(*value.Root.WebDavUrl).To(Equal("https://localhost:9200/dav/spaces/prID$aID%21differentID")) Expect(*value.Root.ETag).To(Equal("101112131415")) Expect(*value.Root.Id).To(Equal("prID$aID!differentID")) @@ -680,7 +680,7 @@ var _ = Describe("Graph", func() { var response libregraph.Drive err := json.Unmarshal(body, &response) Expect(err).ToNot(HaveOccurred()) - Expect(*response.Name).To(Equal("Test Space")) + Expect(response.Name).To(Equal("Test Space")) Expect(*response.DriveType).To(Equal("project")) Expect(*response.DriveAlias).To(Equal("project/testspace")) Expect(*response.Description).To(Equal("This space is for testing")) @@ -967,7 +967,7 @@ var _ = Describe("Graph", func() { }) It("sets the description, alias and name", func() { - drive := libregraph.NewDrive() + drive := libregraph.NewDrive("thename") drive.SetDriveAlias("thealias") drive.SetDescription("thedescription") drive.SetName("thename") @@ -996,7 +996,7 @@ var _ = Describe("Graph", func() { }) It("restores", func() { - drive := libregraph.NewDrive() + drive := libregraph.NewDrive("thename") driveJson, err := json.Marshal(drive) Expect(err).ToNot(HaveOccurred()) @@ -1021,7 +1021,7 @@ var _ = Describe("Graph", func() { }) It("sets the quota", func() { - drive := libregraph.NewDrive() + drive := libregraph.NewDrive("thename") quota := libregraph.Quota{} quota.SetTotal(1000) drive.SetQuota(quota) diff --git a/services/graph/pkg/service/v0/password_test.go b/services/graph/pkg/service/v0/password_test.go index 84a33fd07..51b272804 100644 --- a/services/graph/pkg/service/v0/password_test.go +++ b/services/graph/pkg/service/v0/password_test.go @@ -108,7 +108,7 @@ var _ = Describe("Users changing their own password", func() { Token: "authtoken", }, nil) } - cpw := libregraph.NewPasswordChange() + cpw := libregraph.NewPasswordChangeWithDefaults() cpw.SetCurrentPassword(current) cpw.SetNewPassword(newpw) body, _ := json.Marshal(cpw)