-
Notifications
You must be signed in to change notification settings - Fork 368
Enhances spo site list. Closes #6547
#7004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Enhances spo site list. Closes #6547
#7004
Conversation
| ```md definition-list | ||
| `-t, --type [type]` | ||
| : convenience option for type of sites to list. Allowed values are `TeamSite,CommunicationSite`. | ||
| : convenience option for type of sites to list. Allowed values are `TeamSite,CommunicationSite,fullyArchived,recentlyArchived,archived`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this setup, I'm reopening the discussion on the specs for a bit on this: #6547 (comment)
| let archivedFilter: string = ''; | ||
| switch (options.type) { | ||
| case 'fullyArchived': | ||
| archivedFilter = "ArchiveStatus -eq 'FullyArchived'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use double quotes.
| archivedFilter = "ArchiveStatus -eq 'FullyArchived'"; | |
| archivedFilter = `ArchiveStatus -eq 'FullyArchived'`; |
| }); | ||
|
|
||
| it('passes validation if type fullyArchived specified', async () => { | ||
| const actual = await command.validate({ options: { type: 'fullyArchived' } }, commandInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use commandOptionsSchema.safeParse() instead of command.validate()
| }); | ||
|
|
||
| it('passes validation if type recentlyArchived specified', async () => { | ||
| const actual = await command.validate({ options: { type: 'recentlyArchived' } }, commandInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test file, could you add the commandOptionsSchema.parse() function call everywhere where an options object is constructed?
like:
| const actual = await command.validate({ options: { type: 'recentlyArchived' } }, commandInfo); | |
| const actual = await command.validate({ options: commandOptionsSchema.parse({ type: 'recentlyArchived' }) }, commandInfo); |
Closes #6547
I also modified the command to use zod instead of the old way of working.