Add a test with duplicate item IDs for OneDrive (#2845)
Ensure that as long as drive IDs are unique we can handle items with the same ID if they're in different drives. This is a direct result of observing SharePoint sites that have multiple drives and the root of each drive has the same ID --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [x] 🤖 Test - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) * #2732 #### Test Plan - [ ] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
df1ddb94f3
commit
56cd045bff
@ -1587,6 +1587,64 @@ func (suite *OneDriveCollectionsUnitSuite) TestGet() {
|
|||||||
rootFolderPath2: getDelList("file2"),
|
rootFolderPath2: getDelList("file2"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "TwoDrives_DuplicateIDs_OneItemPageEach_NoErrors",
|
||||||
|
drives: []models.Driveable{
|
||||||
|
drive1,
|
||||||
|
drive2,
|
||||||
|
},
|
||||||
|
items: map[string][]deltaPagerResult{
|
||||||
|
driveID1: {
|
||||||
|
{
|
||||||
|
items: []models.DriveItemable{
|
||||||
|
driveRootItem("root"),
|
||||||
|
driveItem("folder", "folder", driveBasePath1, "root", false, true, false),
|
||||||
|
driveItem("file", "file", driveBasePath1+"/folder", "folder", true, false, false),
|
||||||
|
},
|
||||||
|
deltaLink: &delta,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
driveID2: {
|
||||||
|
{
|
||||||
|
items: []models.DriveItemable{
|
||||||
|
driveRootItem("root"),
|
||||||
|
driveItem("folder", "folder", driveBasePath2, "root", false, true, false),
|
||||||
|
driveItem("file2", "file", driveBasePath2+"/folder", "folder", true, false, false),
|
||||||
|
},
|
||||||
|
deltaLink: &delta2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
errCheck: assert.NoError,
|
||||||
|
prevFolderPaths: map[string]map[string]string{
|
||||||
|
driveID1: {},
|
||||||
|
driveID2: {},
|
||||||
|
},
|
||||||
|
expectedCollections: map[string]map[data.CollectionState][]string{
|
||||||
|
rootFolderPath1: {data.NewState: {}},
|
||||||
|
folderPath1: {data.NewState: {"folder", "file"}},
|
||||||
|
rootFolderPath2: {data.NewState: {}},
|
||||||
|
folderPath2: {data.NewState: {"folder", "file2"}},
|
||||||
|
},
|
||||||
|
expectedDeltaURLs: map[string]string{
|
||||||
|
driveID1: delta,
|
||||||
|
driveID2: delta2,
|
||||||
|
},
|
||||||
|
expectedFolderPaths: map[string]map[string]string{
|
||||||
|
driveID1: {
|
||||||
|
"root": rootFolderPath1,
|
||||||
|
"folder": folderPath1,
|
||||||
|
},
|
||||||
|
driveID2: {
|
||||||
|
"root": rootFolderPath2,
|
||||||
|
"folder": folderPath2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
expectedDelList: map[string]map[string]struct{}{
|
||||||
|
rootFolderPath1: getDelList("file"),
|
||||||
|
rootFolderPath2: getDelList("file2"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "OneDrive_OneItemPage_Errors",
|
name: "OneDrive_OneItemPage_Errors",
|
||||||
drives: []models.Driveable{drive1},
|
drives: []models.Driveable{drive1},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user