From 3f8308cfc1035c1bcabc21ebd42f9fb4f5744f13 Mon Sep 17 00:00:00 2001 From: Ashlie Martinez Date: Tue, 21 Feb 2023 15:39:20 -0800 Subject: [PATCH] Update RestoreAndBackup OneDrive tests --- .../graph_connector_onedrive_test.go | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/internal/connector/graph_connector_onedrive_test.go b/src/internal/connector/graph_connector_onedrive_test.go index 104b0f7cd..dc8d5169c 100644 --- a/src/internal/connector/graph_connector_onedrive_test.go +++ b/src/internal/connector/graph_connector_onedrive_test.go @@ -178,6 +178,8 @@ func (c *onedriveCollection) withFile( case 1: fallthrough case 2: + fallthrough + case 3: c.items = append(c.items, onedriveItemWithData( c.t, name+onedrive.DataFileSuffix, @@ -207,6 +209,8 @@ func (c *onedriveCollection) withFolder( ) *onedriveCollection { switch c.backupVersion { case 0: + fallthrough + case 3: return c case 1: @@ -247,15 +251,15 @@ func (c *onedriveCollection) withPermissions( return c } - c.items = append( - c.items, - onedriveMetadata( - c.t, - name, - name+onedrive.DirMetaFileSuffix, - user, - roles), - ) + metadata := onedriveMetadata( + c.t, + name, + name+onedrive.DirMetaFileSuffix, + user, + roles) + + c.items = append(c.items, metadata) + c.aux = append(c.aux, metadata) return c } @@ -382,6 +386,10 @@ func (suite *GraphConnectorOneDriveIntegrationSuite) TestRestoreAndBackup_Multip }, { pathElements: folderBPath, + perms: permData{ + user: suite.secondaryUser, + roles: readPerm, + }, files: []itemData{ { name: fileName, @@ -895,6 +903,12 @@ func (suite *GraphConnectorOneDriveIntegrationSuite) TestPermissionsRestoreAndNo "", nil, ). + // Call this to generate a meta file with the folder name that we can + // check. + withPermissions( + "", + nil, + ). collection(), }, }