-
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
Blocks: Replace store name string with exposed store definition #27336
Blocks: Replace store name string with exposed store definition #27336
Conversation
It failed again. I tried rerunning the tests locally, apparently, it's all good: As text:
I'm not sure why they're failing in the checks... |
I just tried:
Same results, all tests passed. I also checked manually one of the errors that happened in the build, and apparently, it's all good; the element exists: I'm open to ideas. I have no clue what's happening. 😞 |
Feel free to ignore those failing e2e tests, they shouldn't be relevant to your changes. As far as I remember, there is PR that tries to make them more stable on CI. |
Umm... Yeah. Sorry... I should've checked the E2E status before commenting/testing. Apparently, #27347 will fix it 😸 |
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.
Everything looks good, thank you for another great PR 👍
|
||
jest.mock( '@wordpress/data', () => { | ||
return { | ||
select: jest.fn( ( store ) => { | ||
switch ( store ) { | ||
case 'core/blocks': { | ||
case [ mockStoreName ]: |
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.
Quite tricky, but it makes a lot of sense 👍
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 could be replacing the switch
statement to an if
if that's better 😅.
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 was commenting about the whole process of mocking. It is it what it is, we better leave it 😃
Description
Addresses #27088. Replaces the
core/blocks
store name references (hardcoded strings) with the exposedstore
definitions. Had to change somecore/blocks
unit tests too, since they're testing the exposed definition now.How has this been tested?
Just making sure
npm run test
wasn't failing.Screenshots
Types of changes
Code refactoring, non-breaking change.
Checklist: