Problem/Motivation
Currently there are no Javascript tests that prove that contextual links work. This make it very hard for the Settings tray module and any other module that provides links via contextual links to write Javascript tests that prove there links do what they are suppose to.
Proposed resolution
Write Javascript tests for contextual links.
Perhaps create a JS Cotnextual links testing trait so that other modules can easily test their own links.
Remaining tasks
Write the tests.
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2821724-15.patch | 10.19 KB | tedbow |
| #15 | interdiff-13-15.txt | 1021 bytes | tedbow |
| #13 | 2821724-13.patch | 10.26 KB | tedbow |
| #7 | 2821724-contextual-7.patch | 6.59 KB | tim.plunkett |
| #7 | 2821724-contextual-7-interdiff.txt | 4.81 KB | tim.plunkett |
Comments
Comment #2
tedbowOk here is patch that test contextual links. It tests clicking "Edit" in the toolbar to show contextual links and without toolbar.
To test without toolbar I am forcing the button that shows contextual links to be visible. I don't see a way around this.
It also creates a trait so that other modules like Settings Tray don't have to redo the work.
Comment #4
tedbowForgot to add @group
Comment #6
tedbowCopy/paste error in .info.yml file wrong package.
Comment #7
tim.plunkettI spent too much time figuring out that GastonJS is busted, and mouseOver() just doesn't work as expected.
In doing that debugging, I refactored the trait a bit, I think this is more readable.
Comment #8
tedbow@tim.plunkett thanks for trying to get it work with mouseOver. Yes I had no luck either.
The refactor looks good.
Comment #9
tim.plunkettSeems like the bug is https://github.com/jcalderonzumba/gastonjs/issues/19, #2773791: Clicking elements with children in Javascript tests throws a GastonJS exception adds a workaround for this.
Comment #10
tedbow@tim.plunkett re: #9
I just checked that work around yes it does fix this issue, though you would have to slightly alter our test to use it.
Comment #13
tedbowRerolled and also removed the duplicate functions in the Settings Tray module tests.
Comment #15
tedbowOk enabling
contextaul_testmodule broke the existing test functiontestContextualLinksVisibility()So now only enabling that module in the new test function.
Comment #16
tim.plunkettI think this is ready to go. Thanks @tedbow for your persistence.
Comment #19
larowlanFixed on commit
Committed as 5c31080 and pushed to 8.5.x
Cherry-picked as d18903c and pushed to 8.4.x