Skip to content

Conversation

@MathijsVerbeeck
Copy link
Contributor

Closes #6547

I also modified the command to use zod instead of the old way of working.

@martinlingstuyl martinlingstuyl self-requested a review October 22, 2025 14:42
@martinlingstuyl martinlingstuyl self-assigned this Oct 22, 2025
```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`.
Copy link
Contributor

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'";
Copy link
Contributor

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.

Suggested change
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);
Copy link
Contributor

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);
Copy link
Contributor

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:

Suggested change
const actual = await command.validate({ options: { type: 'recentlyArchived' } }, commandInfo);
const actual = await command.validate({ options: commandOptionsSchema.parse({ type: 'recentlyArchived' }) }, commandInfo);

@martinlingstuyl martinlingstuyl marked this pull request as draft October 22, 2025 14:59
@martinlingstuyl martinlingstuyl added the hacktoberfest-accepted Accept for hacktoberfest, will merge later label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accept for hacktoberfest, will merge later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance spo site list to return archived sites

2 participants