-
Notifications
You must be signed in to change notification settings - Fork 22
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 tests for Footer component #397
add tests for Footer component #397
Conversation
26f56b4
to
9f2b779
Compare
I prefer to not depend on link's order. <a
href={repoUrl}
_other_props_here_
aria-label={
intl.formatMessage({
id: "components.Footer.repositoryLinkLabel",
defaultMessage: "GitHub",
})
}
>
<Icon icon="github" />
</a> And its test with const repositoryLink = screen.getByRole("link", { name: "GitHub" });
expect(repositoryLink).toHaveAttribute("href", "https://github.com/edgehog-device-manager/edgehog"); Also, can we use different values for |
0da6db7
to
0ffb323
Compare
1b45089
to
8bd27d5
Compare
2c69a31
to
6535f06
Compare
017f8a0
to
e2b48aa
Compare
c6e5dc4
to
173202f
Compare
173202f
to
7eb4aad
Compare
const appNameElement = screen.getByText("Edgehog Device Manager"); | ||
expect(appNameElement).toBeVisible(); | ||
|
||
const appVersionElement = screen.getByText(/0.1.0-alpha.1/); |
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.
Dot in RegExp matches any single character except line terminators, so we need to escape it with backslash. Otherwise test will pass even with appVersion="0x1x0-alphax1"
property.
const appVersionElement = screen.getByText(/0.1.0-alpha.1/); | |
const appVersionElement = screen.getByText(/0\.1\.0-alpha\.1/); |
bda286a
to
e976d24
Compare
Add acessibility labels for icon only links. Signed-off-by: Haris Bikovic <[email protected]>
Generated with `npm run i18n:extract` Signed-off-by: Haris Bikovic <[email protected]>
Signed-off-by: Haris Bikovic <[email protected]>
e976d24
to
d69903b
Compare
2309cf5
into
edgehog-device-manager:release-0.7
Related #390
This PR containes tests for the Footer component.