-
Notifications
You must be signed in to change notification settings - Fork 0
Experiment/playwright #50
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
Conversation
# What While testing, I discovered that the `disabled` feature was not working as expected. The visuals weren’t being applied correctly, which required some CSS work to correct. This also fixed the issue where the pointer events weren’t being disabled at the same time. There were two issues: the concrete controls were being applied to the wrong component, and the CSS cascade was being read in the wrong order. `disabled` takes priority over virtually everything else, so it has to go at the bottom of the CSS field. After that, I applied [the ARIA rules for disabled links](https://www.w3.org/TR/html-aria/#example-communicate-a-disabled-link-with-aria), which specifies that “to communicate a link as ‘disabled,’ remove the `href` attribute and style accordingly.” That, in turn, caused the underline to go away, which was not desired, so when the displayed part is a “disabled anchor,” I added CSS to force the underline to return. I have added a story to show that the disabled button and disabled link work as expected.
✅ Deploy Preview for authentik-elements-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Ken Sternberg <[email protected]>
| expect(button).toHaveElementClass("danger"); | ||
| // Verify slotted text content | ||
| const component = document.querySelector("ak-button"); | ||
| expect(component?.textContent?.trim()).toBe("Click to leave"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the API, do these need await?
| expect(component?.textContent?.trim()).toBe("Click to leave"); | |
| await expect(component?.textContent?.trim()).toBe("Click to leave"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, expect.element does a lookup asynchronously, so it needs to be awaited; in this case, we're just using the standard expect syntax, which is synchronous.
Co-authored-by: Teffen Ellis <[email protected]> Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]> Signed-off-by: Ken Sternberg <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]> Signed-off-by: Ken Sternberg <[email protected]>
elements: Move testing to vitest + playwright
What
Remove WebdriverIO as our testing framework, and switch to using vitest + playwright. Re-write all existing tests to use the new testing framework.
Many of the tests removed were auto-generated and, it turns out, unnecessary. They tested that if you set a property value, the property value was set; this is only relevant if we’re actively changing property values at the host level, something you should never do except when using
reflect, which none of the components in the infrastructure collection do.What’s left are the purely functional tests. In the case of Icons, there are still a lot because a lot of values are forwarded from the
:hostto the icon. But many are simply missing because they’re pure CSS; they only manifest because:host([somesetting])triggered a CSS change, and have no behavioral consequences. As a result, they can’t really be tested, only eyeballed, which is why there are storybooks for all of those.This PR also includes a github action to run these tests in CI/CD.