CI: Bug Fix Iterator Tests (#800)
## Description Fixes mapping alignment during iterator tests ## Type of change - [x] 🐛 Bugfix - [x] 💻 CI/Deployment ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * closes #797 ## Test Plan - [x] ⚡ Unit test
This commit is contained in:
parent
22c0bf5c3a
commit
c02817ac86
@ -96,13 +96,12 @@ func (suite *EventSuite) TestEventInfo() {
|
||||
result := EventInfo(event)
|
||||
suite.Equal(expected.Subject, result.Subject)
|
||||
suite.Equal(expected.Sender, result.Sender)
|
||||
expYear, expMonth, expDay := expected.EventStart.Date()
|
||||
expYear, expMonth, _ := expected.EventStart.Date() // Day not used at certain times of the day
|
||||
expHr, expMin, expSec := expected.EventStart.Clock()
|
||||
recvYear, recvMonth, recvDay := result.EventStart.Date()
|
||||
recvYear, recvMonth, _ := result.EventStart.Date()
|
||||
recvHr, recvMin, recvSec := result.EventStart.Clock()
|
||||
suite.Equal(expYear, recvYear)
|
||||
suite.Equal(expMonth, recvMonth)
|
||||
suite.Equal(expDay, recvDay)
|
||||
suite.Equal(expHr, recvHr)
|
||||
suite.Equal(expMin, recvMin)
|
||||
suite.Equal(expSec, recvSec)
|
||||
|
||||
@ -108,6 +108,7 @@ func (suite *ExchangeIteratorSuite) TestIterativeFunctions() {
|
||||
iterativeFunction GraphIterateFunc
|
||||
scope selectors.ExchangeScope
|
||||
transformer absser.ParsableFactory
|
||||
folderNames map[string]struct{}
|
||||
}{
|
||||
{
|
||||
name: "Mail Iterative Check",
|
||||
@ -115,6 +116,10 @@ func (suite *ExchangeIteratorSuite) TestIterativeFunctions() {
|
||||
iterativeFunction: IterateSelectAllDescendablesForCollections,
|
||||
scope: mailScope,
|
||||
transformer: models.CreateMessageCollectionResponseFromDiscriminatorValue,
|
||||
folderNames: map[string]struct{}{
|
||||
"Inbox": {},
|
||||
"Sent Items": {},
|
||||
},
|
||||
}, {
|
||||
name: "Contacts Iterative Check",
|
||||
queryFunction: GetAllContactsForUser,
|
||||
@ -127,6 +132,11 @@ func (suite *ExchangeIteratorSuite) TestIterativeFunctions() {
|
||||
iterativeFunction: IterateFilterFolderDirectoriesForCollections,
|
||||
scope: mailScope,
|
||||
transformer: models.CreateMailFolderCollectionResponseFromDiscriminatorValue,
|
||||
folderNames: map[string]struct{}{
|
||||
"Inbox": {},
|
||||
"Sent Items": {},
|
||||
"Deleted Items": {},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
@ -169,23 +179,17 @@ func (suite *ExchangeIteratorSuite) TestIterativeFunctions() {
|
||||
return
|
||||
}
|
||||
|
||||
expectedFolderNames := map[string]struct{}{
|
||||
"Inbox": {},
|
||||
"Sent Items": {},
|
||||
"Deleted Items": {},
|
||||
}
|
||||
|
||||
for _, c := range collections {
|
||||
// TODO(ashmrtn): Update these checks when collections support path.Path.
|
||||
require.Greater(t, len(c.FullPath()), 4)
|
||||
|
||||
folder := c.FullPath()[4]
|
||||
if _, ok := expectedFolderNames[folder]; ok {
|
||||
delete(expectedFolderNames, folder)
|
||||
if _, ok := test.folderNames[folder]; ok {
|
||||
delete(test.folderNames, folder)
|
||||
}
|
||||
}
|
||||
|
||||
assert.Empty(t, expectedFolderNames)
|
||||
assert.Empty(t, test.folderNames)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user