Extra test for some recursive delete behavior (#2478)
## Description Folders replaced after a delete should not have their subfolders reparented to the new folder. ## 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 ## Test Plan - [ ] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
7187b969e4
commit
efe1b6292d
@ -1739,6 +1739,40 @@ func (suite *HierarchyBuilderUnitSuite) TestBuildDirectoryTreeMultipleSubdirecto
|
||||
},
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "ReplaceDeletedSubtreeWithNew",
|
||||
inputCollections: func(t *testing.T) []data.BackupCollection {
|
||||
oldInbox := mockconnector.NewMockExchangeCollection(inboxStorePath, inboxLocPath, 0)
|
||||
oldInbox.PrevPath = inboxStorePath
|
||||
oldInbox.ColState = data.DeletedState
|
||||
|
||||
newCol := mockconnector.NewMockExchangeCollection(inboxStorePath, inboxLocPath, 1)
|
||||
newCol.ColState = data.NewState
|
||||
newCol.Names[0] = workFileName2
|
||||
newCol.Data[0] = workFileData2
|
||||
|
||||
return []data.BackupCollection{oldInbox, newCol}
|
||||
},
|
||||
expected: expectedTreeWithChildren(
|
||||
[]string{
|
||||
testTenant,
|
||||
service,
|
||||
testUser,
|
||||
category,
|
||||
},
|
||||
[]*expectedNode{
|
||||
{
|
||||
name: testInboxID,
|
||||
children: []*expectedNode{
|
||||
{
|
||||
name: workFileName2,
|
||||
data: workFileData2,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "ReplaceMovedDirectory",
|
||||
inputCollections: func(t *testing.T) []data.BackupCollection {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user