add more tests!

This commit is contained in:
41666 2019-03-30 09:17:11 -05:00
parent 77bf715b7b
commit f7e2898633
No known key found for this signature in database
GPG key ID: BC51D07640DC10AF
11 changed files with 241 additions and 38 deletions

View file

@ -0,0 +1,64 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Role /> renders correctly 1`] = `
<rolestyled
onClick={[Function]}
onTouchEnd={null}
onTouchStart={null}
style={
Object {
"--role-color-active": "hsl(0, 0%, 100%)",
"--role-color-base": "hsl(0, 0%, 100%)",
"--role-color-outline": "hsla(0, 0%, 100%, 0.7)",
"--role-color-outline-alt": "hsla(0, 0%, 100%, 0.4)",
}
}
title={null}
>
Test Role
</rolestyled>
`;
exports[`<Role /> when disabled, does not trigger onToggle on click 1`] = `
<rolestyled
active={false}
disabled={true}
onClick={null}
onTouchEnd={[Function]}
onTouchStart={[Function]}
style={
Object {
"--role-color-active": "hsl(0, 0%, 100%)",
"--role-color-base": "hsl(0, 0%, 100%)",
"--role-color-outline": "hsla(0, 0%, 100%, 0.7)",
"--role-color-outline-alt": "hsla(0, 0%, 100%, 0.4)",
}
}
title="This role has unsafe permissions."
>
Test Role
</rolestyled>
`;
exports[`<Role /> when disabled, handles touch hover events 1`] = `
<rolestyled
disabled={true}
onClick={null}
onTouchEnd={[Function]}
onTouchStart={[Function]}
style={
Object {
"--role-color-active": "hsl(0, 0%, 100%)",
"--role-color-base": "hsl(0, 0%, 100%)",
"--role-color-outline": "hsla(0, 0%, 100%, 0.7)",
"--role-color-outline-alt": "hsla(0, 0%, 100%, 0.4)",
}
}
title="This role has unsafe permissions."
>
unsafe role
<tooltip>
This role has unsafe permissions.
</tooltip>
</rolestyled>
`;

View file

@ -0,0 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<RoleDemo /> renders 1`] = `
<Role
active={false}
onToggle={[Function]}
role={
Object {
"color": "#ffffff",
"name": "test demo role",
}
}
/>
`;