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

Add missing integration tests for the Checkbox label #2152

Closed
vursen opened this issue Sep 23, 2021 · 0 comments · Fixed by #2229
Closed

Add missing integration tests for the Checkbox label #2152

vursen opened this issue Sep 23, 2021 · 0 comments · Fixed by #2229
Assignees
Labels
a11y Accessibility issue

Comments

@vursen
Copy link
Contributor

vursen commented Sep 23, 2021

At the present time, the Checkbox's integration tests cover only the case when the label is set right after the checkbox's creation within a single round-trip:

The setLabelAsHtml method:

private void addCheckboxWithHtmlLabel() {
// begin-source-example
// source-example-heading: Checkbox with simple html markup in the label
Checkbox checkbox = new Checkbox();
checkbox.setLabelAsHtml(
"Accept the <a href='https://vaadin.com/privacy-policy'>privacy policy</a>");
// end-source-example
addCard("Checkbox with simple html markup in the label", checkbox);
checkbox.setId("html-checkbox");
}

The setLabel method:

private void addDefaultCheckbox() {
// begin-source-example
// source-example-heading: Default Checkbox
Checkbox checkbox = new Checkbox();
checkbox.setLabel("Default Checkbox");
// end-source-example
addCard("Default Checkbox", checkbox);
checkbox.setId("default-checkbox");
}

However, there is another case when the user may want to change the label on an existing checkbox (that has already been sent to the client once).

This case is unfortunately not covered now that might result in undesirable passing Flow integrations tests with the new accessible <vaadin-checkbox> (see vaadin/web-components#2539). They shouldn't pass because the way the Flow Checkbox sets labels now (by overriding textContent or innerHTML) unintentionally removes the slotted <label> element that should end up throwing an exception.

@vursen vursen changed the title Add more integration tests for the Checkbox's label Add more integration tests for the Checkbox label Sep 23, 2021
@vursen vursen changed the title Add more integration tests for the Checkbox label Add missing integration tests for the Checkbox label Sep 23, 2021
@vursen vursen added the a11y Accessibility issue label Sep 27, 2021
@vursen vursen self-assigned this Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant