Cli-microsoft365: Add 'spo list view field remove' command capability

Created on 28 Dec 2018  路  6Comments  路  Source: pnp/cli-microsoft365

Summary

Add a support for spo list view field remove command in order to :

  • [x] Remove/hide existing list column to an existing list view

    • [x] --fieldId / --fieldTitle (ID or Title not both)

    • [x] --viewId / --viewTitle (ID or Title not both)

    • [x] --listId / --listTitle (ID or Title not both)

    • [x] -u, --webUrl Web URL

    • [x] --confirm (to suppress prompt)

To Do

  • [x] Add command from solution
  • [x] Add documentation of usage (MkDocs)
  • [x] Validate cmdlet usage
  • [x] Validate Unit test
good first issue new feature work in progress

Most helpful comment

Hi @VelinGeorgiev, thx for your answer 馃槈
I understood why I didn't have a 100% coverage but I didn't know how I had to do to have 100% with my current spec.
Finally, after several hours of testing and sweat, I found what I have to do to have 100% 馃槄

All 6 comments

Don't forget listId and listTitle to specify the list where the view is located. Other than that, the spec looks solid. You want to take it yourself or let others take a shot at it?

Because I'm working on the spo list view field add may I suggest to take this one too ?

All yours!

I need some help to understanding the coverage.

I don't know what in my spec file is missing and why a statement is not covered :/

screenshot 2019-01-20 at 00 43 30

Someone can explain to me ? 馃槂

The coverage identifies if that specific line has been triggered/visited by a test at least once.

If you aim for 100 persent then that line should be covered by at least one test that goes all the way to call the cb() function.

In your case, you probably do not have a test that checks if the command has successfully executed I.e last request.post succeeded and returned success promise.

Even the rest call does not have anything to return, we should test the request.post success promise return (you are probably missing in your tests) as well as request.promise failiure return (you already tested)

I hope that makes sense.

Hi @VelinGeorgiev, thx for your answer 馃槈
I understood why I didn't have a 100% coverage but I didn't know how I had to do to have 100% with my current spec.
Finally, after several hours of testing and sweat, I found what I have to do to have 100% 馃槄

Was this page helpful?
0 / 5 - 0 ratings