-
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
Testing: Remove snapshot from Post Editor Template Mode test and target expected string instead #41563
Testing: Remove snapshot from Post Editor Template Mode test and target expected string instead #41563
Conversation
…et expected string instead
@kevin940726 I've just added you as a reviewer since you worked on the refactor to playwright for this test in #40175. I see the snapshot approach predates the refactor, so happy for feedback on the removal if you think it's safer we don't get rid of the snapshot 🙂 |
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 totally agree with this 👍 . Awesome job! 💯
Size Change: 0 B Total Size: 1.24 MB ℹ️ View Unchanged
|
Thanks for the speedy review! 🙇 |
What?
Remove the snapshot from the
Allow creating custom block templates in classic themes
test in the Post Editor Template Mode playwright tests.Why?
While working on #40875, I noticed that whenever I made a change to the classnames that are attached to the group block, this test would fail due to the snapshot test used, which looks at all the markup of the rendered preview, and if any markup has changed, the test fails.
I think, much like the test directly above it, that this test is just wanting to check that the added template is included in the preview. Testing that all markup is identical seems to be a bit outside the scope of this test, and could be making it a little more rigid than needed. So, in this PR, we switch to looking for the expected string within the response.
How?
Just a random paragraph added to the template
insteadTesting Instructions
Check that the playwright tests pass. You can also attempt to run it locally via: