User tests: Successful: Unsuccessful:
Test for Pull Request #48060 and Issue #48058 .
This pull request adds a comprehensive integration test to verify that the content article view correctly respects the option hierarchy in the frontend. The test ensures that the correct option (global, menu, or article) is applied to the show_create_date setting depending on how the article is accessed (via a category blog menu, direct link, or a single article menu item).
New integration test for option hierarchy:
ArticleOptionsHierarchy.cy.js to test that the show_create_date option is resolved according to the hierarchy when viewing articles through different menu paths or direct links. The test covers cases where menu options use "use_article", fallback to global, and where menu or article options override each other.E2E Integration Tests
Fails at the moment.
Should pass with PR #48060
Here’s a demo PR with the patch as a cherry-pick
https://github.com/LadySolveig/joomla-cms/actions/runs/29039828500/job/86195681502?pr=16
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Unit Tests |
| Labels |
Added:
Unit/System Tests
PR-5.4-dev
|
||
I have tested this item ✅ successfully on e54381f
Before PR #48060 has been merged:
Running: site/components/com_content/ArticleOptionsHierarchy.cy.js (60 of 157)
Test in frontend that the content article view honours the option hierarchy
reached through a category blog menu (article options take priority)
✓ resolves a menu 'use_article' option to the article option (show) (325ms)
✓ resolves a menu 'use_article' option to the article option (hide) (160ms)
✓ falls back to the global option for 'use_article' when the article is Use Global (show) (153ms)
✓ falls back to the global option for 'use_article' when the article is Use Global (hide) (154ms)
1) applies the article option even when the menu leaves it as Use Global (regression #48058)
reached by direct access without a menu item (article options take priority)
2) applies the article option over the global one (hide)
3) applies the article option over the global one (show)
✓ honours the global option when the article is Use Global (167ms)
reached through its own single article menu item (menu options take priority)
✓ menu item option overrides the article option (hide) (164ms)
✓ menu item option overrides the article option (show) (168ms)
7 passing (15s)
3 failing
After PR #48060 has been merged and a new test case has been added:
Running: site/components/com_content/ArticleOptionsHierarchy.cy.js (60 of 157)
Test in frontend that the content article view honours the option hierarchy
reached through a category blog menu (article options take priority)
✓ resolves a menu 'use_article' option to the article option (show) (260ms)
✓ resolves a menu 'use_article' option to the article option (hide) (332ms)
✓ falls back to the global option for 'use_article' when the article is Use Global (show) (367ms)
✓ falls back to the global option for 'use_article' when the article is Use Global (hide) (390ms)
✓ applies the article option even when the menu leaves it as Use Global (regression #48058) (218ms)
reached by direct access without a menu item (article options take priority)
✓ applies the article option over the global one (hide) (122ms)
✓ applies the article option over the global one (show) (109ms)
✓ honours the global option when the article is Use Global (114ms)
reached through its own single article menu item (menu options take priority)
✓ menu item option overrides the article option (hide) (153ms)
✓ menu item option overrides the article option (show) (230ms)
✓ menu item option overrides the global option when the article is Use Global (hide) (130ms)
11 passing (4s)
For the new test case adde with commit 1d67b1b there is no before patch test, but I have reviewed that the new test case does what it claims to do.
I wouldn’t necessarily say I like it 😄, but I can definitely see the point. Done. Thx for the review 💚
There are multiple describe() functions withing a global describe function. Why is that? Normally we have just one describe function and then the test cases per file. Also should be the text in the it function continue the one from the describe function like (just an example, not sure if it makes sense in this pr):
describe('Test in frontend that the content article view honours the option hierarchy and', () => {
it("can resolve a menu 'use_article' option to the article option (show)", () => {
@laoneo It just affects the readability (see screenshot) of the test results.
Feel free to write a review of the changes you’re proposing.
I’ll just commit them then. Personally, I like the breakdown because it makes it easier for me to spot if the tests fails, but if you prefer a different style, I’m open to it.
Till now we have one test suite per file, which I again would like to keep as it makes readability a bit easier and less complex.
I’ve no idea how you’re hoping to improve readability with this, but just tell me specifically what you want.
Should I really split the whole thing into three files, or should I remove the subheadings?
In my view, neither option makes it any clearer, but at the end of the day, I really don’t care.
Better to remove the subheadings (suites).
I have tested this item ✅ successfully on e54381f
Before PR #48060 has been merged:
After PR #48060 has been merged and a new test case has been added:
For the new test case adde with commit 1d67b1b there is no before patch test, but I have reviewed that the new test case does what it claims to do.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48071.