-
Notifications
You must be signed in to change notification settings - Fork 135
E2E: Update the way selecting a future date for schedulePost #665
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
Conversation
It's similar to the current way this file is doing
|
In case, it helps, here is my screen record for the specific failed test with this fix: |
nielslange
left a comment
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.
LGTM!
I tested this PR using the following steps:
- Start Docker
- Run
npm run wp-env start - Run
npm run test-e2e - One test case is failing
> edit-flow@2.0.0 test-e2e
> wp-scripts test-e2e --config tests/e2e/jest.config.js
FAIL tests/e2e/specs/calendar-body.test.js (25.717s)
● Calendar Body › expects a scheduled post can be dragged and dropped
expect(received).not.toContain(expected) // indexOf
Expected value: not "Scheduled Post"
Received array: ["Scheduled Post", "Published Post"]
94 | expect(await scheduledPostDay.evaluate((node) => {
95 | return Array.prototype.slice.call(node.querySelectorAll('.item-headline.post-title strong')).map((n) => n.innerText)
> 96 | })).not.toContain('Scheduled Post');
| ^
97 | });
98 | });
at _callee3$ (specs/calendar-body.test.js:96:17)
at asyncGeneratorStep (specs/calendar-body.test.js:7:103)
at _next (specs/calendar-body.test.js:9:194)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (../../node:internal/process/task_queues:96:5)
PASS tests/e2e/specs/editorial-comments.test.js (7.023s)
PASS tests/e2e/specs/calendar-header.test.js (5.558s)
PASS tests/e2e/specs/simple.test.js
Test Suites: 1 failed, 3 passed, 4 total
Tests: 1 failed, 5 passed, 6 total
Snapshots: 0 total
Time: 39.61s, estimated 40s
Ran all test suites.
- Check out this PR
- Run
npm run test-e2e - All test cases are successful
> edit-flow@2.0.0 test-e2e
> wp-scripts test-e2e --config tests/e2e/jest.config.js
PASS tests/e2e/specs/calendar-body.test.js (25.829s)
PASS tests/e2e/specs/calendar-header.test.js (5.989s)
PASS tests/e2e/specs/simple.test.js
PASS tests/e2e/specs/editorial-comments.test.js (6.472s)
Test Suites: 4 passed, 4 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: 39.641s
Ran all test suites.
mikeyarce
left a comment
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.
Looks good to me! I just had a small nitpick about one of the comments.
Thanks @htdat - so nice to see that green checkmark next to all the tests!
|
Thanks @nielslange and @mikeyarce! I've merged this PR after updating the comment :D |
Fix #652
Description
The root cause is described here #652 (comment)
To fix this issue, I am changing the way selecting a future date for schedulePost:
Some notes:
e2e-test-utils. I pulled Gutenberg and searched on this specific folderpackages/e2e-test-utils/src, which hosts this package.Steps to Test
If possible, we can use the diff in this comment #652 (comment) to generate new screenshots with this fix.
With this fix, the date of the post is expected now: