The module currently does not have a common method for test classes to check whether a specific link exists or not in the admin toolbar.
Each class currently has its own "copy" of the same methods/code: protected function assertMenuHasHref($url)
The same goes for assertMenuDoesNotHaveHref
.
The methods are all marked as protected
, so they could not be called from a separate test class, requiring another set of methods to be implemented for the test, which is nor practical or sustainable in terms of maintenance.
Add the new trait AdminToolbarHelperTestTrait
to provide a common method for module's test classes to check that a specific link exists or not in the admin toolbar.
The trait could then be used by any test class whether Functional
or FunctionalJavascript
and provide a standard method for asserting a link exists in the admin toolbar.
Additionally, we could improve the method of asserting a link exists by adding more specific conditions, such as the link text, display position (order) or CSS classes.
Replace current implementations in \Drupal\Tests\admin_toolbar\Functional\AdminToolbarToolsSortTest
by using the trait's method.
Needs review
3.0
Automated tests
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.