## Description Exposing user IDs in addition to user emails. ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [X] 🐹 Trivial/Minor ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> ## Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [X] ⚡ Unit test - [ ] 💚 E2E
65 lines
1.3 KiB
Go
65 lines
1.3 KiB
Go
package m365
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"github.com/alcionai/corso/src/internal/tester"
|
|
)
|
|
|
|
type M365IntegrationSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
func TestM365IntegrationSuite(t *testing.T) {
|
|
if err := tester.RunOnAny(
|
|
tester.CorsoCITests,
|
|
); err != nil {
|
|
t.Skip(err)
|
|
}
|
|
|
|
suite.Run(t, new(M365IntegrationSuite))
|
|
}
|
|
|
|
func (suite *M365IntegrationSuite) SetupSuite() {
|
|
_, err := tester.GetRequiredEnvSls(
|
|
tester.M365AcctCredEnvs)
|
|
require.NoError(suite.T(), err)
|
|
}
|
|
|
|
func (suite *M365IntegrationSuite) TestUsers() {
|
|
ctx, flush := tester.NewContext()
|
|
defer flush()
|
|
|
|
acct := tester.NewM365Account(suite.T())
|
|
|
|
users, err := Users(ctx, acct)
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NotNil(suite.T(), users)
|
|
require.Greater(suite.T(), len(users), 0)
|
|
}
|
|
|
|
func (suite *M365IntegrationSuite) TestUserIDs() {
|
|
acct := tester.NewM365Account(suite.T())
|
|
|
|
ids, err := UserIDs(context.Background(), acct)
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NotNil(suite.T(), ids)
|
|
require.Greater(suite.T(), len(ids), 0)
|
|
}
|
|
|
|
func (suite *M365IntegrationSuite) TestGetEmailAndUserID() {
|
|
acct := tester.NewM365Account(suite.T())
|
|
|
|
ids, err := GetEmailAndUserID(context.Background(), acct)
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NotNil(suite.T(), ids)
|
|
require.Greater(suite.T(), len(ids), 0)
|
|
}
|