- Issue created by @divanova
- last update
about 1 year ago 22 pass - Status changed to Needs work
4 months ago 8:49pm 6 August 2024 - 🇨🇦Canada mparker17 UTC-4
@divanova, thank you very much for the contributon; and thank you for your patience with me!
This patch looks great: the only thing that's preventing me from merging it is automated tests. I need automated tests, because I don't want future changes to the sitemap module to break this functionality, and break your website as a result!
I think you could do this by modifying
\Drupal\Tests\sitemap\Functional\SitemapMenuTest::testMenus()
to include some more assertions. For example, the following checks for an "expanded" class on an HTML <a> tag with the link text$node_1_title
...$this->assertEquals('expanded', $this->getSession()->getPage()->find('named', ['link', $node_1_title])->getAttribute('class'));
... note that example might not work (because I haven't checked it with the patch applied)... you'll have to look closer at the code in
\Drupal\Tests\sitemap\Functional\SitemapMenuTest
to see what it's supposed to do. You may also have to look at the the PHPUnit output files ("artifacts") to see what actually happens in the test environment.Thank you again!