CLI and selectors tests for folder prefix match (#1011)

## Description

Specifying a folder on the CLI should cause the system to do a prefix match on that folder when doing a restore, backup details, or selector reduce operation.

Recently updated behavior, adjusting tests to match new expectations.

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Issue(s)

* #913 

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2022-09-30 13:52:19 -07:00 committed by GitHub
parent 5e8b67a606
commit dd7b84871f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -71,6 +71,13 @@ var (
Emails: selectors.Any(), Emails: selectors.Any(),
}, },
}, },
{
Name: "EmailsFolderPrefixMatch",
Expected: testdata.ExchangeEmailItems,
Opts: utils.ExchangeOpts{
EmailFolders: []string{testdata.ExchangeEmailInboxPath.Folder()},
},
},
{ {
Name: "EmailsBySubject", Name: "EmailsBySubject",
Expected: testdata.ExchangeEmailItems, Expected: testdata.ExchangeEmailItems,

View File

@ -44,6 +44,19 @@ func (suite *SelectorReduceSuite) TestReduce() {
}, },
expected: testdata.ExchangeEmailItems, expected: testdata.ExchangeEmailItems,
}, },
{
name: "ExchangeMailFolderPrefixMatch",
selFunc: func() selectors.Reducer {
sel := selectors.NewExchangeRestore()
sel.Include(sel.MailFolders(
selectors.Any(),
[]string{testdata.ExchangeEmailInboxPath.Folder()},
))
return sel
},
expected: testdata.ExchangeEmailItems,
},
{ {
name: "ExchangeMailSubject", name: "ExchangeMailSubject",
selFunc: func() selectors.Reducer { selFunc: func() selectors.Reducer {