diff --git a/src/internal/connector/sharepoint/data_collections.go b/src/internal/connector/sharepoint/data_collections.go index 281bc1bf3..f3b9f998a 100644 --- a/src/internal/connector/sharepoint/data_collections.go +++ b/src/internal/connector/sharepoint/data_collections.go @@ -163,14 +163,11 @@ func collectLibraries( // collectPages constructs a sharepoint Collections struct and Get()s the associated // M365 IDs for the associated Pages -// -//nolint:unused func collectPages( ctx context.Context, creds account.M365Config, serv graph.Servicer, tenantID, siteID string, - scope selectors.SharePointScope, updater statusUpdater, ctrlOpts control.Options, ) ([]data.Collection, error) { diff --git a/src/internal/connector/sharepoint/data_collections_test.go b/src/internal/connector/sharepoint/data_collections_test.go index 4daca0877..c36e1e924 100644 --- a/src/internal/connector/sharepoint/data_collections_test.go +++ b/src/internal/connector/sharepoint/data_collections_test.go @@ -5,10 +5,12 @@ import ( "github.com/microsoftgraph/msgraph-sdk-go/models" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/alcionai/corso/src/internal/connector/graph" "github.com/alcionai/corso/src/internal/connector/onedrive" + "github.com/alcionai/corso/src/internal/connector/support" "github.com/alcionai/corso/src/internal/tester" "github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/selectors" @@ -128,3 +130,37 @@ func driveItem(name string, path string, isFile bool) models.DriveItemable { return item } + +type SharePointPagesSuite struct { + suite.Suite +} + +func TestSharePointPagesSuite(t *testing.T) { + tester.RunOnAny( + t, + tester.CorsoCITests, + tester.CorsoGraphConnectorTests, + tester.CorsoGraphConnectorSharePointTests) + suite.Run(t, new(SharePointPagesSuite)) +} + +func (suite *SharePointPagesSuite) TestCollectPages() { + ctx, flush := tester.NewContext() + defer flush() + + t := suite.T() + siteID := tester.M365SiteID(t) + a := tester.NewM365Account(t) + account, err := a.M365Config() + require.NoError(t, err) + + updateFunc := func(*support.ConnectorOperationStatus) { + t.Log("Updater Called ") + } + + updater := &MockUpdater{UpdateState: updateFunc} + + col, err := collectPages(ctx, account, nil, account.AzureTenantID, siteID, updater, control.Options{}) + assert.NoError(t, err) + assert.NotEmpty(t, col) +}