Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upChange Detection: Add a test case for post trashing. #18290
Merged
+33
−29
Conversation
There's a (likely related) end-to-end test failure:
|
await page.waitForSelector( '.editor-post-saved-state.is-saved' ); | ||
|
||
// Check that the dialog didn't show. | ||
await assertIsDirty( false ); |
This comment has been minimized.
This comment has been minimized.
aduth
Nov 5, 2019
Member
From your comment at #18275 (comment) :
This works because refreshing a page with a dialog doesn't get rid of the dialog. So if navigation didn't happen because the dialog stopped it,
assertIsDirty
wouldn't assertfalse
.
But the 'dialog'
event handler isn't added until assertIsDirty
is called, so if the dialog was already present by the time we reach this line, the event callback would never be triggered.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fixed! |
packages/e2e-tests/specs/editor/various/change-detection.test.js
Outdated
Show resolved
Hide resolved
packages/e2e-tests/specs/editor/various/change-detection.test.js
Outdated
Show resolved
Hide resolved
|
CreativeDive
added a commit
to CreativeDive/gutenberg
that referenced
this pull request
Nov 12, 2019
* Change Detection: Add a test case for post trashing. * Change Detection: Fix the way redirection is asserted. * Update packages/e2e-tests/specs/editor/various/change-detection.test.js Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com> * Change Detection: Fix test race condition.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
epiqueras commentedNov 5, 2019
Follows #18275
Description
This PR fixes and reintroduces the test case from #18275.
It also replaces some ad-hoc saving code with the correct e2e test util,
saveDraft
.How has this been tested?
The new tests were verified to test for the issue fixed in #18275.
Checklist: