Remove duplicate IDs from customer account module links in Hummingbird#1033
Remove duplicate IDs from customer account module links in Hummingbird#1033Codencode wants to merge 3 commits into
Conversation
|
I would just delete the id and call it a day. There can be more than 2 links - header, my account, footer, what ID will you use then? :-) |
|
@Hlavtox |
|
@Hlavtox |
tblivet
left a comment
There was a problem hiding this comment.
Hi @Codencode, I’m in favor of removing these IDs, but this would certainly break UI tests based on what I see here: https://github.com/PrestaShop/ui-testing-library/blob/main/src/versions/develop/pages/FO/hummingbird/myAccount/index.ts
What do you think @PrestaShop/qa-automation?
@tblivet good catch! Maybe we could solve this by moving the current ID values to the This would still remove the duplicated IDs from the DOM, but it would keep a stable selector that could be used by the UI tests, for example by updating selectors from What do you think? |
|
@Codencode We have some elements that use specific classes in Hummingbird and are used in UI tests. They are defined as CSS modifiers, like |
@tblivet These classes already exist, so the PR is fine, meaning we just need to remove the IDs, right? |
|
No, we don’t have it for now. We have |
|
@tblivet, if I understood your suggestion correctly, I added dedicated classes to these module account links so we can keep stable selectors without relying on duplicated IDs. |
tblivet
left a comment
There was a problem hiding this comment.
@Codencode Yes, that’s exactly what I meant 👍 We just need @PrestaShop/qa-automation to update the UI tests.
|
Perfect! |
|
Good question 🤷♂️ I’ll try to create a PR this afternoon if you want 👍 |
|
Here is the associated PR for UI tests: PrestaShop/ui-testing-library#991 |
displayCustomerAccount. Since the same hook output can appear in both the account sidebar and the main My account page, static ids may be duplicated in the DOM. Removing those ids avoids invalid duplicated markup without requiring coordinated changes across modules.Related PRPrestaShop/ps_emailalerts#159Notes
This PR is part of a two-step fix. It introduces the account rendering context in Hummingbird by passingisMainAccountto thedisplayCustomerAccounthook. A companion PR in ps_emailalerts consumes that parameter to generate distinct link IDs and complete the fix.