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

Remove rename rn UI tests #39042

Merged
merged 8 commits into from
Mar 9, 2022
Merged

Conversation

jostnes
Copy link
Contributor

@jostnes jostnes commented Feb 24, 2022

Description

This PR removes 1 React Native E2E UI tests for Gutenberg Mobile that is covered on other tests: should be able to add a new Paragraph block

This PR also includes renaming changes, I initially thought the 3 features were the same and was ready to combine them but realized there are 3 different blocks with typos, fixed the typos in this PR.

Testing Instructions

Ensure that React Native UI Tests still pass on CI. PR on gutenberg-mobile: wordpress-mobile/gutenberg-mobile#4608

Screenshots

N/A

Types of changes

Removed redundant tests and fixed typos

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Feb 24, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @jostnes! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Mamaduka Mamaduka requested a review from hypest February 24, 2022 04:58
@geriux geriux added Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) Mobile App - Automation Label used to initiate Mobile App PR Automation labels Feb 24, 2022
@hypest
Copy link
Contributor

hypest commented Feb 25, 2022

Thanks for opening this PR @jostnes !

should be able to insert block into post test is covered on inserts between 2 existing blocks test

Perhaps the title of the first test is not too accurate, but seems to be doing a lot more than adding a block from the inserter. One particularly "sensitive" action is performs is to put text inside paragraph blocks, which is a very critical flow to cover. The inserts between 2 existing blocks test doesn't cover that. Perhaps it's still a redundant test if that operation is covered elsewhere but, can you make sure? Thanks!

should be able to insert block at the beginning of post from the title is covered on should be able to create a post with heading and paragraph blocks

Hmm, the key differentiator of the first text is to add a new block from the inserter while being in the title (and expecting the new block to land in the content top instead of the end, for example). My impression is that the second test is not covering that 🤔 . Perhaps I'm missing some detail? Please let me know 🙇

should be able to add a new Paragraph block

Agreed, at this stage many tests actually perform the operations of this one.

and should be able to create a post with multiple paragraph blocks tests are covered on multiple tests

My understanding is that the critical bit covered by this test (pasting multiline text that creates multiple blocks) is only covered by the should be able to insert block into post test, but that too is removed in this PR so, not sure, is this indeed covered elsewhere or can we just rename the test to make it more accurate?

@jostnes
Copy link
Contributor Author

jostnes commented Feb 28, 2022

Hello @hypest, thanks for the review! All are valid concerns, appreciate you being thorough with the PR 🙇

My understanding is that the critical bit covered by this test (pasting multiline text that creates multiple blocks) is only covered by the should be able to insert block into post test, but that too is removed in this PR so, not sure, is this indeed covered elsewhere or can we just rename the test to make it more accurate?

The test case that I was comparing it to is the heading and paragraph blocks tests and it looks that it does cover multiple blocks being created and with multiline. Though the difference is one creates 2 paragraphs, the one that I'm proposing to delete creates 3 paragraphs. Recording of the tests here for comparison and to ensure that it's covered:

  1. should be able to create a post with heading and paragraph blocks
  2. should be able to create a post with multiple paragraph blocks

One particularly "sensitive" action is performs is to put text inside paragraph blocks, which is a very critical flow to cover.
You are right, the other test does not cover this.

the key differentiator of the first text is to add a new block from the inserter while being in the title (and expecting the new block to land in the content top instead of the end, for example)

Good points! The two other tests while they cover what the test mention it should cover, they do not cover the specific cases you mentioned. I may have been a bit too eager to remove these tests 😅 I will revert my changes for that, slightly rename one test and keep the steps as-is for now.

@hypest
Copy link
Contributor

hypest commented Feb 28, 2022

The test case that I was comparing it to is the heading and paragraph blocks tests and it looks that it does cover multiple blocks being created and with multiline. Though the difference is one creates 2 paragraphs, the one that I'm proposing to delete creates 3 paragraphs. Recording of the tests here for comparison and to ensure that it's covered:

should be able to create a post with heading and paragraph blocks
should be able to create a post with multiple paragraph blocks

Ah, I think I see where the different is, sorry I didn't point it out clearly earlier: the first test creates different paragraphs by inserting them via the UI (Inserter), while the second is creating them as part of hitting the "Enter/Return" key while typing. In other words, the second test is testing the writing flow of multi-paragraph text, while the first one is doing that "manually" via the UI. The code paths for those flows are actually different so, I think the tests don't exactly cover the same cases. WDYT?

@jostnes
Copy link
Contributor Author

jostnes commented Mar 1, 2022

Ah, I think I see where the different is, sorry I didn't point it out clearly earlier: the first test creates different paragraphs by inserting them via the UI (Inserter), while the second is creating them as part of hitting the "Enter/Return" key while typing.

Ah right, I see now what you mean. Using "Enter/Return" key to create new paragraphs is being covered in different test cases via the sendTextToParagraphBlock function. But now that I think about it, it may get removed/overwritten when refactoring the other tests, so yeah it's best to leave it in for now since this test specifically tests that one flow. I'll revert the change.

@hypest
Copy link
Contributor

hypest commented Mar 2, 2022

so yeah it's best to leave it in for now since this test specifically tests that one flow. I'll revert the change.

Ah, thanks for confirming Jos! At this stage, can you also update the PR description to better reflect the current state of the PR in terms of what it changes/introduces? My understanding is that at this point, there's only 1 test removed but yeah, happy to take another pass after updating the description. Thanks!

@jostnes
Copy link
Contributor Author

jostnes commented Mar 3, 2022

can you also update the PR description to better reflect the current state of the PR in terms of what it changes/introduces?

Oops apologies for not updating this earlier, I've updated the description to better reflect the changes now. Thanks again for reviewing!

@hypest
Copy link
Contributor

hypest commented Mar 3, 2022

I notice that the PR checklist has many items unchecked Jos, can you go over them all to mark as done? They are meant to be like a signal that the PR author has indeed gone through the checks. Thanks!

@jostnes jostnes requested a review from hypest March 8, 2022 01:49
Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the iterations on this PR @jostnes!

Feel free to merge, and the process I'd suggest is to merge the Gutenberg PR first, update the gutenberg-mobile PR to point to the "merged commit commit on Gutenberg trunk" and then merge that too when it gets green on CI. Thanks!

@hypest hypest merged commit c64e6b3 into WordPress:trunk Mar 9, 2022
@github-actions github-actions bot added this to the Gutenberg 12.8 milestone Mar 9, 2022
@jostnes jostnes deleted the remove-rename-rn-ui-tests branch March 15, 2022 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository Mobile App - Automation Label used to initiate Mobile App PR Automation Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants