-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[select] feat(MultiSelect2): allow creating multiple items #5424
[select] feat(MultiSelect2): allow creating multiple items #5424
Conversation
Thanks for your interest in palantir/blueprint, @ZeRego! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
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 best way to run unit tests here would be to focus on one component, let's say Select2 to start, and scope the test runner to just those tests by temporarily editing select2Tests.tsx
to say describe.only("<Select2>", ...
You can scope down the tests further by editing selectComponentSuite.tsx
to say describe.only("create", ..
, etc. Make sure to revert these edits before pushing to the PR later.
Then you can go into packages/select and run yarn test:karma:debug
. This will run the tests once, and start a watcher to re-run them when source or test files change.
ping @ZeRego, any interest in continuing this PR? |
aab0882
to
030e9e3
Compare
@adidahiya Sorry for the delay. Testing was a bit of a pain since I couldn't figure out how to run the tests with breakpoints in Webstorm IDE. Looks like I was missing the event keydown even though the other tests only have the keyup event so I'm now confused on how those tests are passing 🤷 |
@ZeRego I'll take a look at your updates. In the future, please don't force-push to PR branches; I like to see all the commits in their original timeline. I squash all PRs into a single commit when merging. |
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.
docs preview looks good!
the test coverage failure looks like a bug in our test coverage configuration. we shouldn't be checking docs-app code for coverage. please update packages/select/karma.conf.js:
const baseConfig = createKarmaConfig({
dirname: __dirname,
coverageExcludes: [
"../docs-app/*",
],
});
My suggestion above didn't work, for some reason Karma doesn't allow me to match those globs on files outside the current working directory. I've added a commit here which uses |
Fixes #5384
Checklist
Changes proposed in this pull request:
createNewItemFromQuery
to support array of new itemsReviewers should focus on:
wouldCreatedItemMatchSomeExistingItem
should behave. Since the logic for splitting the query into multiple items is on the user implementation side, it will display the create item option when there is only a partial match. E.g: query "test, test1" items are "test" and "test1" and test already exists in the list. We would still show the create item optionScreenshot