#54843 closed enhancement (fixed)
Add end to end test case for Trash a single post and restore post from trash
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests commit |
| Focuses: | Cc: |
Description
Add two new test cases in wpe2e for the trash a single post and restore post from the trash.
This ticket is to add an E2E test for this feature
Change History (16)
This ticket was mentioned in PR #2182 on WordPress/wordpress-develop by pavanpatil1.
4 years ago
#1
- Keywords has-patch has-unit-tests added
This ticket was mentioned in PR #2186 on WordPress/wordpress-develop by pooja-muchandikar.
4 years ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/54843
JustinyAhin commented on PR #2186:
4 years ago
#3
Hello @pooja-muchandikar,
Here are a few things that I noticed and that could be improved in your PR:
- Test files end with
.test.js, so your test file would becomerestore-trash-post.test.js loginUser()is not used in the tests, so it can be removed from the imports- It is a good idea to remove all posts before your tests (see https://github.com/WordPress/wordpress-develop/blob/371966a187081662c155ef98ddb7a681dc10f268/tests/e2e/specs/edit-posts.test.js#L10-L12 for example)
JustinyAhin commented on PR #2186:
4 years ago
#4
@pooja-muchandikar thanks for adding the updates. Your tests are very clean and they all pass. Here is something that we could improve.
It might make sense to assert the message that appears when the post is trashed. In this case, it'll be "1 post permanently deleted."
That will help in case the trashing steps outputs an error. By asserting the success message, we make sure that we have the expected behavior.
JustinyAhin commented on PR #2186:
4 years ago
#5
Except the above comment, the PR looks fine to me.
@tellthemachines @hellofromtonya you might want to give a look, before we move to merging it.
pooja-muchandikar commented on PR #2186:
4 years ago
#6
Hi @JustinyAhin,
Previously, assertion message was only added, but while running the test cases CI was failing, as the number of posts were getting deleting dynamically, that's the reason changed the selector.
pooja-muchandikar commented on PR #2186:
4 years ago
#7
Hi @JustinyAhin, @hellofromtonya
I hope you are doing well!
Wanted to know if there is any update on this? Do I need to make the changes or can we proceed further?
https://github.com/WordPress/wordpress-develop/pull/2186#issuecomment-1041162514
JustinyAhin commented on PR #2186:
4 years ago
#8
@tellthemachines @hellofromtonya you might want to give a look, before we move to merging it.
Hello @pooja-muchandikar, the PR is fine for me. Can you bring it up during the next Test team meeting on Thursday, so it can be reviewed by a committer?
pooja-muchandikar commented on PR #2186:
4 years ago
#9
Sure
Thanks!
pooja-muchandikar commented on PR #2186:
4 years ago
#10
Hi @kevin940726,
I have addressed all the feedbacks shared by you and also combined the test cases, please take a look.
Thanks!
pooja-muchandikar commented on PR #2186:
4 years ago
#12
Hi @kevin940726,
Made all necessary changes and also commented on respective feedbacks with reasoning. Also tried to work on few indention changes please take a look.
Thanks!
pooja-muchandikar commented on PR #2186:
4 years ago
#13
Hi @kevin940726,
I hope you are doing well! Just checking if you checked latest commits on this PR.
#14
@
4 years ago
- Keywords commit added
- Owner set to hellofromTonya
- Status changed from new to reviewing
PR 2186 has been approved by @kevin940726 (Thank you Kai!). Marking for commit. Prepping commit now.
hellofromtonya commented on PR #2186:
4 years ago
#16
Committed via changeset https://core.trac.wordpress.org/changeset/52839. Thank you @pooja-muchandikar @JustinyAhin @kevin940726 for your contributions ⭐
Trac ticket: https://core.trac.wordpress.org/ticket/54843