-
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
base: main
Are you sure you want to change the base?
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]>
| @property({ reflect: true, type: Boolean, attribute: "disabled" }) | ||
| public _disabled = false; | ||
| @property({ reflect: true, type: Boolean }) | ||
| disabled = false; |
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.
Revealed during testing: the disabled flag wasn't being read correctly (I'm still new to this whole internals-with-CSS-states thing), and the button wasn't being disabled correctly.
| --button--m-danger--BackgroundColor: var(--button--m-link--m-danger--BackgroundColor); | ||
| } | ||
|
|
||
| :is(:host:disabled, :host([disabled])) #main { |
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.
Part of the problem is that I was writing the disabled state to the wrong place; obviously, the concrete CSS declaration must go on the component being modified.
| writeFile, | ||
| } from "./lib/utilities.mjs"; | ||
|
|
||
| // @ts-expect-error no types provided |
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.
We now provide all of these...
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.