Skip to content
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

Block validation warnings for deprecated blocks cause e2e tests to fail #17003

Open
tellthemachines opened this issue Aug 12, 2019 · 0 comments

Comments

@tellthemachines
Copy link
Contributor

commented Aug 12, 2019

Describe the bug

When changing a classname on an existing block, block validation console warnings are triggered when loading posts containing an older version of that block, even though the change is dealt with in the block deprecation.
The problem is that the code in packages/blocks/src/api/validation.js also runs during the demo post e2e test in packages/e2e-tests/specs/demo.test.js. If any console log is output then, the test fails, even if the block in question is valid.

To reproduce

  1. Make a change to e.g. a gallery block classname;
  2. Create section in block deprecated.js, update all the fixture markup etc.;
  3. Navigate to /wp-admin/post-new.php?gutenberg-demo in your local and check there are validation errors in the console;
  4. Run e2e tests locally;
  5. Observe test failure in packages/e2e-tests/specs/demo.test.js > content should load without making the post dirty as a result of the console log mentioned above.

Expected behavior

Tests should not fail for reasons unrelated to what they are testing. In this case, they fail because of a console.log in the code, not because the block is actually invalid.

This doesn't happen if the e2e tests are run in production mode, so that's probably the easiest way to fix this issue.

Edit: this still happens in production mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.