Improve Tests for AdminToolbarToolsSettingsFormTest

Created on 14 March 2025, about 2 months ago

Problem/Motivation

Currently, the module doesn't test any of the configuration variables defined by the admin_toolbar_tools module, except, saving its settings form with its default values, see:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

See module's settings default values:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

Steps to reproduce

Run PHPUNIT Functional Test AdminToolbarToolsSettingsFormTest.

Proposed resolution

Add tests and checks for different values for the different configuration variables.

max_bundle_number
Test the display of the links for different values of max_bundle_number:
Test 0, lower than, greater than the test_bundles_number.
For the assert/check we could use an xpath expression to check for the count of expected entity links under tested entity menu item.
Maybe something like this could be useful:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...
With random names generated instead, preferably.

hoverintent_functionality
Check whether the library is found in the response, see for example:
https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/tests/src/Fu...

show_local_tasks
Check whether the local tasks menu is found in the toolbar in the response, see example above.
 

Any help, comments, suggestions or feedback would be greatly appreciated.
Thanks!

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France dydave

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024