This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
senadir
added
the
needs: tests
The issue/PR needs tests before it can move forward.
label
Jun 25, 2020
Size Change: 0 B Total Size: 1.59 MB ℹ️ View Unchanged
|
nerrad
approved these changes
Jun 25, 2020
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 Nadir! Great idea. It really looks like something that would be useful to the Gutenberg project in general and you should consider contributing there too!
The only concern I have is that the matching could break if the text being matched against changes in the editor. However that's unlikely because it would mean a change in the strings being translated.
Still that should be trivial to fix if it happened.
).toBeNull(); | ||
|
||
await expect( page ).toMatchElement( block.class ); | ||
await expect( page ).toRenderBlock( block ); |
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 such a nice reduction of code 👍
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a custom matcher to jest for us to use in E2E tests
toRenderBlock
it checks if the page has any broken blocks in it, either due to not being registered, validation issues, or js error (caught by our block boundary), it also checks if the blocks exist, since the rest can all pass with no block.The matcher is async so you will need to append
await
for it to work.closes #2709
How to use
Or if you follow the new process of writing tests, it should be like this