Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: data-qa="error-link-<number>" attribute removed in version 72 of DS #3456

Open
petechd opened this issue Dec 10, 2024 · 2 comments
Open
Labels
Bug Something isn't working Community backlog An issue raised on the community backlog High priority

Comments

@petechd
Copy link

petechd commented Dec 10, 2024

Describe the bug

When I try to run functional test suites in eq-questionnaire-runner application (the getText() command):
Screenshot 2024-12-10 at 14 14 45
it breaks not able to find the data-qa="error-link-<number>" that was previously present and used to generate elements for our functional tests:
Screenshot 2024-12-10 at 14 14 57
Seems like the data-qa="error-link-<number>" attribute was removed from the template, the only data-qa is "error-list":
Screenshot 2024-12-10 at 14 15 10

Expected behaviour / outcome

Attribute should be present in the template for the first error panel: data-qa="error-link-1.

List the steps necessary to reproduce the bug

Open a survey in eq-questionnaire-runner app after updating the Design System version from 71 to 72 and investigate the page template.

Additional context

No response

What version of the ONS Design System are you using?

72.0.1

What device(s) are you using?

Desktop

What operating system(s) are you using?

macOS

What browser(s) are you using?

Chrome

@petechd petechd added Bug Something isn't working Community backlog An issue raised on the community backlog High priority labels Dec 10, 2024
@rmccar
Copy link
Contributor

rmccar commented Dec 10, 2024

Had an initial investigation into this, its because of some changes to the list component we no longer set custom attributes on the link element which we may need to rethink and potentially set the attributes on the link when it is available.
During this investigation I noticed this is complicated by the fact we allow setting of list level attributes and list item level attributes. When there is an ordered list but there is only one item the list is rendered as a single <p> tag. This means there is no list level element so both types of attributes get set on the <p> element. In this case we may just need to work out a way of setting them or note in the documentation that only the item one will be set. Currently when setting the same named attribute for both like data-qa which is often used the list level one is the only one that is set as it overwrites the item level one. Which is what is happening here and causing this error in the tests mentioned above.

@MagdalenaLarge
Copy link

@petechd, thank you for raising this issue. Team will investigate best solution for it and we will come back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Community backlog An issue raised on the community backlog High priority
Projects
None yet
Development

No branches or pull requests

3 participants