Skip to content

Commit

Permalink
Migrate remaining Link UI tests to Playwright (#52828)
Browse files Browse the repository at this point in the history
* migrate test: will use Post title as link text if link to existing post is created without any text selected

* removed old test

* migrated test: can be created by selecting text and clicking Link

* removed old test

* migrated test: will not automatically create a link if selected text is not a valid HTTP based URL

* updated snapshots and migrated test: can be created without any text selected

* migrated test: can be created instantly when a URL is selected

* migrated test: is not created when we click away from the link input

* migrated test: can be edited

* migrated test: can be removed

* test migrated: allows Left to be pressed during creation when the toolbar is fixed to top

* test migrated: allows Left to be pressed during creation in Docked toolbar mode

* migrate test: can be edited with collapsed selection

* migrated test: allows use of escape key to dismiss the url popover

* migrated test: can be modified using the keyboard once a link has been set

* removed comment

* improved selector

* migrated test: adds an assertive message for screenreader users when an invalid link is set

* migrated test: should not display text input when initially creating the link

* migrated test: should display text input when the link has a valid URL value

* migrated test: should preserve trailing/leading whitespace from linked text in text input

* migrated test: should allow for modification of link text via Link UI

* migrated test: capture the text from the currently active link even if there is a rich text selection

* migrated test: should not show the Link UI when selection extends beyond link boundary

* migrated test: should not show the Link UI when selection extends into another link

* migrated test: should correctly replace targetted links text within rich text value when multiple matching values exist

* Apply re-wording suggestions from Code Review

* Fix broken test due to upsteam changes

* Create test post using REST

* Prefer concretions in tests

* Use requestUtils to create post

* Improve test resilience by using more precise selector

* Further improvements to test resilience by using more precise selectors

* Provide context to usage of `getByPlaceholder`

* Update other uses of getByPlaceholder

* Remove redundant comment

* Simplify test to essentials and provide context

* Add util to cover inaccessible selection of Link Popover

* Improve arrow key under link test

* Improve test desc

* Abstract direct usage of CSS locator in anticipation of refactor

* Make sure test is testing what is says it will

* Use standard helper

* Shuffle test order

* Improve test resilience by avoiding reliance on tab stops

* Use standard utils

* Replace custom query with standard util

* Make it clear which button is being targetted

* Improve test comprehension by using more than simply a period

* Increase test comprehensibility but improving assertions

* Avoid use of keyboard where not necessary

* Apply nits from code review

Co-authored-by: Ben Dwyer <[email protected]>

* Improve comment

---------

Co-authored-by: Dave Smith <[email protected]>
Co-authored-by: Ben Dwyer <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2023
1 parent 5939b4d commit 75835ac
Show file tree
Hide file tree
Showing 3 changed files with 979 additions and 987 deletions.

This file was deleted.

Loading

0 comments on commit 75835ac

Please sign in to comment.