-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improve local search + improve Navigator Search UI #5009
Conversation
🦋 Changeset detectedLatest commit: 7bae942 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8b42733
to
881f086
Compare
const reactIntl = jest.requireActual("react-intl"); | ||
const intl = reactIntl.createIntl({ | ||
locale: "en", | ||
}); | ||
|
||
return { | ||
...reactIntl, | ||
useIntl: () => intl, | ||
}; |
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.
suggestion: using actual react-intl does not have sense because it doesn't work without context
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.
It does 😄 Related issue: formatjs/formatjs#1477 (comment)
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.
Nope it doesn't, it works in your case because you mocked useIntl, but you could do this like that:
const reactIntl = jest.requireActual("react-intl"); | |
const intl = reactIntl.createIntl({ | |
locale: "en", | |
}); | |
return { | |
...reactIntl, | |
useIntl: () => intl, | |
}; | |
jest.mock("react-intl", () => ({ | |
useIntl: jest.fn(() => ({ | |
formatMessage: jest.fn(x => x.defaultMessage), | |
})), | |
})); |
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 meant that it does work 😄
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.
@Cloud11PL test should mock dependencies, not mock and provide their actual implementation. You are not testing react-intl here, you test only your code and the only you care about is that your code calls intl with proper arguments.
* migrate from fuzzaldrin to fusejs * fix types * improve navigator search + port to new macaw-ui * fix type issue * fixes * final fixes * add fuzzySearch separate test * cr fixes * cr fixes
* migrate from fuzzaldrin to fusejs * fix types * improve navigator search + port to new macaw-ui * fix type issue * fixes * final fixes * add fuzzySearch separate test * cr fixes * cr fixes
* migrate from fuzzaldrin to fusejs * fix types * improve navigator search + port to new macaw-ui * fix type issue * fixes * final fixes * add fuzzySearch separate test * cr fixes * cr fixes
* migrate from fuzzaldrin to fusejs * fix types * improve navigator search + port to new macaw-ui * fix type issue * fixes * final fixes * add fuzzySearch separate test * cr fixes * cr fixes
* migrate from fuzzaldrin to fusejs * fix types * improve navigator search + port to new macaw-ui * fix type issue * fixes * final fixes * add fuzzySearch separate test * cr fixes * cr fixes
fuzzaldrin
withfuse.js
What type of PR is this?
Related Issues or Documents
Usage Instructions, Screenshots, Recordings
Search:
![CleanShot 2024-07-01 at 12 15 25](https://private-user-images.githubusercontent.com/13994677/344637597-71c64642-3872-48f2-80fd-87ee7b5ebc64.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTY4NjgsIm5iZiI6MTczOTQxNjU2OCwicGF0aCI6Ii8xMzk5NDY3Ny8zNDQ2Mzc1OTctNzFjNjQ2NDItMzg3Mi00OGYyLTgwZmQtODdlZTdiNWViYzY0LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzMTYwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU5NTA3MDVlNGIxMWZkM2E4MzU1ZWM5NTJhZTYyNGEwNmRiZTY2ZGMxOTc2YTlhNDk1Y2EyOGU3MTE2MGRmNTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZmY20mNF2Kk7VPkZ1l9wPFIBaCG1hG6DtMiASPAMWzk)
![CleanShot 2024-07-01 at 12 15 58](https://private-user-images.githubusercontent.com/13994677/344637843-a28db719-b8e2-49ac-a848-b8a97fd11be6.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTY4NjgsIm5iZiI6MTczOTQxNjU2OCwicGF0aCI6Ii8xMzk5NDY3Ny8zNDQ2Mzc4NDMtYTI4ZGI3MTktYjhlMi00OWFjLWE4NDgtYjhhOTdmZDExYmU2LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzMTYwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1ZDhmOTcyNmQyYzUxODZjNGNjYTBhN2M2OTFkMjgzY2Y5MzZjMjllOTMzMmMxYjc0ZjE0MmM4MDk1MDQwOTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.br66UfzNq5CfST9YPnbvBepF8qRsC389l4txHo5heYA)
Navigator Search:
![CleanShot 2024-07-01 at 12 14 26](https://private-user-images.githubusercontent.com/13994677/344637305-2b13ebb0-7106-4d1a-8f67-c80f6895eef6.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTY4NjgsIm5iZiI6MTczOTQxNjU2OCwicGF0aCI6Ii8xMzk5NDY3Ny8zNDQ2MzczMDUtMmIxM2ViYjAtNzEwNi00ZDFhLThmNjctYzgwZjY4OTVlZWY2LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzMTYwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ODhlMWQ0NWFmODQyMjc2YjczZmNjOTJhNmNlMDdlZDIwNWRmMmM4OWNkZWJlNTllM2JhNzBkZDY4NmQxYzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Eizkc-UMpsNf6cwSNit7kipziWcNNg32bcbD-F-F1aw)
Have you written tests?
[Optional] Description