-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI kmip acceptance #7129
UI kmip acceptance #7129
Conversation
// yarn gen-story-md some-component | ||
// | ||
// or if the story is for a component in an in-repo-addon or an engine: | ||
// yarn gen-story-md some-component name-of-engine |
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 think this note should be added to the Storybook instructions in the README as well!
import notes from './list-view.md'; | ||
import ArrayProxy from '@ember/array/proxy'; | ||
|
||
let filtered = ArrayProxy.create({ content: [] }); |
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.
out of curiosity, why'd you have to use ArrayProxy
here?
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.
The component usually takes a ember data model array which can have meta information on it and we use that meta information to know if we should show pagination, but also to be able to tell the difference between an empty list and a list that is empty because of an overly-specific filter. Maybe this should change to use RecordArrary from ember-data instead 🤔
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 looked into it and using RecordArray directly is kinda a pain, but ArrayProxy is the base class of RecordArray so this is probably good enough.
total: 100, | ||
}); | ||
|
||
let items = { |
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 noticed in the JSDoc comments that items
was supposed to be an array, though this is an object. can the component handle either type? or will items
always be an object?
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.
These are the items options for the storybook select knob, I'll rename it so that's more apparent. The component usually takes an array though, but RecordArray can have meta
items associated to on it.
|
||
assert.equal(credentialsPage.listItemLinks.length, 1, 'renders a single credential'); | ||
|
||
// revoke the credentials |
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.
this is just a style preference, but is it possible to separate the create and delete tests for scopes, roles, and credentials into separate tests (i.e. testing create and delete separately for each entity)? the tests are starting to look pretty long which can be harder to debug later. if it's too much work to set up each test though then i don't think it' a big deal at all though. 🤷♀
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.
Yep, I'll look at divvying these up more.
import { create, clickable, fillable, visitable } from 'ember-cli-page-object'; | ||
import ListView from 'vault/tests/pages/components/list-view'; | ||
|
||
export default create({ |
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.
whew, setting up all of these page objects is a lot of work. props to you for adding them + all these tests!
… the expected place for in-repo addons and engines
…f in-repo addons and engines
11455fe
to
786add6
Compare
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.
Two small questions but looks great! I echo Noelle's praise of the tests and all of those page objects!
return { | ||
__path__: function(options) { | ||
if (options.inRepoAddon) { | ||
let addon = findAddonByName(project, options.inRepoAddon); |
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.
isn't there a possibility that the addon wouldn't be found, findAddonByName
would return -1
and it wouldn't have a .root
? How does this handle that case?
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 wasn't sure so I tried this out, and got this message:
ember g story flash-message -ir foo
installing story
You specified the 'in-repo-addon' flag, but the in-repo-addon 'foo' does not exist. Please check the name and try again.
✨
* @param items=null {Array} - An array of items to render as a list | ||
* @param [itemNoun=null {String}] - A noun to use in the empty state of message and title. | ||
* @param [message=null {String}] - The message to display within the banner. | ||
* @yields Object with `item` that is the current item in the loop. |
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.
ooh how does jsdom2md handle @yields? does it make it into the story file? We have a custom template for md and I'm not sure it includes these. If it's just for actually documenting in the code here that makes sense too, but I don't think it would make it to the md file.
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.
Yeah this was for documentation, but I think it could make sense to pull into a separate table maybe? https://github.com/hashicorp/vault/pull/7129/files/786add6b8b28b4cd84706f73609cf1d2c609b902#diff-db4113d4519f04b3176ff85e5de7e1b4R11 is the param table. Maybe we should look at how ember-cli-addon-docs does it's api doc too because it's 👌 https://ember-learn.github.io/ember-cli-addon-docs/docs/api/components/docs-demo
Adds acceptance tests for the new KMIP secrets engine.
These won’t run here because of the
!enterprise
filter on the test in Circle, but here is a screencap of them passing locally:Additionally, this changes the story blueprint and the
gen-story-md
script to write markdown files and story files to the folder inlib/{addon}/stories/
and updates storybooks’ config to look for stories in thelib
directory as well.