-
Notifications
You must be signed in to change notification settings - Fork 328
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
Extends 'spo list get' command with support for retrieving any default list in a given site #6447
base: main
Are you sure you want to change the base?
Extends 'spo list get' command with support for retrieving any default list in a given site #6447
Conversation
Thanks, we'll have a look at it ASAP. |
@tmaestrini I added the |
@Adam-it Thanks a lot! :) Looking forward to my very first contribution on the M365 cli when this PR gets closed! ;) |
Do you want me to do something on this? Is there anything missing? |
@tmaestrini I don't think there is anything missing. We have a lot of PRs to process but we will try to catch up with this ASAP |
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.
Nice work @tmaestrini, I suggest we make some minor changes.
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 add another example to the docs where we retrieve the default list.
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.
Good idea, will do so 👍.
I will include this example in the "Examples" section on https://pnp.github.io/cli-microsoft365/cmd/spo/list/list-get/:
Get the default document library located in the specified site.
m365 spo list get --webUrl https://contoso.sharepoint.com/sites/project-x
Can you tell me: the response differs in this case because the script returns the properties of the default libraries. How should I document this in the "Response" section?
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.
Does the response differ? I just did a quick check, and the response looks the same, no?
it('retrieves the default list in the specified site by providing a webUrl', async () => { | ||
const defaultSiteList = { ...listResponse, BaseTemplate: 101, ParentWebUrl: "/", ListItemEntityTypeFullName: "SP.Data.Shared_x0020_DocumentsItem" }; | ||
|
||
sinon.stub(request, 'get').resolves({ |
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 check that the right URL was passed.
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.
@milanholemans What do you mean by this statement? I mean we we test if a user only passes the webUrl
option. Then – and only then – the default document library is returned.
I probably don't understand how or why you want to check if the correct URL has been passed?
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.
Just like in other tests, instead of a sinon.stub(...).resolves(...)
, we should do sinon.stub(...).callsFake(opts => if (opts.url === <URL>) return result;
. This way we ensure that the right request was made.
Closes #5856.
This PR substitutes PR #6445