diff --git a/src/internal/operations/test/group_test.go b/src/internal/operations/test/group_test.go index 5c3710bba..ab3b44cd3 100644 --- a/src/internal/operations/test/group_test.go +++ b/src/internal/operations/test/group_test.go @@ -42,6 +42,8 @@ func (suite *GroupsBackupIntgSuite) SetupSuite() { func (suite *GroupsBackupIntgSuite) TestBackup_Run_incrementalGroups() { sel := selectors.NewGroupsRestore([]string{suite.its.group.ID}) + // sel.Filter(sel.Site(suite.its.group.RootSite.ID)) + ic := func(cs []string) selectors.Selector { sel.Include(sel.LibraryFolders(cs, selectors.PrefixMatch())) return sel.Selector diff --git a/src/internal/operations/test/helper_test.go b/src/internal/operations/test/helper_test.go index 84b8b8431..c77d3df3b 100644 --- a/src/internal/operations/test/helper_test.go +++ b/src/internal/operations/test/helper_test.go @@ -398,6 +398,21 @@ func generateContainerOfItems( restoreCfg.Location = destFldr restoreCfg.IncludePermissions = true + if sel.Service == selectors.ServiceGroups { + restoreCfg.SubService.Type = path.SharePointService + restoreCfg.SubService.ID = siteID + } + + var protectedResource idname.Provider = sel + + // In case of groups, we use the root site as the restore target + if sel.Service == selectors.ServiceGroups { + rootSite, err := ctrl.AC.Sites().GetByID(ctx, siteID, api.CallConfig{}) + require.NoError(t, err, clues.ToCore(err)) + + protectedResource = idname.NewProvider(siteID, ptr.Val(rootSite.GetName())) + } + dataColls := buildCollections( t, service, @@ -410,7 +425,7 @@ func generateContainerOfItems( rcc := inject.RestoreConsumerConfig{ BackupVersion: backupVersion, Options: opts, - ProtectedResource: sel, + ProtectedResource: protectedResource, RestoreConfig: restoreCfg, Selector: sel, }