-
-
Notifications
You must be signed in to change notification settings - Fork 805
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
✨Add support to search by emoji #1164
✨Add support to search by emoji #1164
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Hey! Can we add a test scenario here to cover this new behaviour?
gitmoji/src/components/GitmojiList/__tests__/gitmojiList.spec.js
Lines 36 to 68 in b934df0
describe('when user search the fire gitmoji', () => { | |
beforeAll(() => { | |
Router.useRouter.mockReturnValue(stubs.routerMock()) | |
}) | |
it('should find the fire gitmoji by code', () => { | |
const wrapper = renderer.create(<GitmojiList {...stubs.props} />) | |
const instance = wrapper.root | |
const query = 'Fire' | |
renderer.act(() => { | |
instance | |
.findByType('input') | |
.props.onChange({ target: { value: query } }) | |
}) | |
expect(instance.findAllByType('article').length).toEqual(1) | |
}) | |
it('should find the fire gitmoji by description', () => { | |
const wrapper = renderer.create(<GitmojiList {...stubs.props} />) | |
const instance = wrapper.root | |
const query = 'remove' | |
renderer.act(() => { | |
instance | |
.findByType('input') | |
.props.onChange({ target: { value: query } }) | |
}) | |
expect(instance.findAllByType('article').length).toEqual(1) | |
}) | |
}) |
Thanks! 🙏🏼
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.
LGTM! Thanks 🚀
Fixes Issue: #1163
Description
Compare searchinput with emojis in the data. Showing the emoji that match.
Examples:
Tests