Skip to content

Commit

Permalink
fix: Add tests to tenantMembersList component, fix coverage exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Apr 9, 2024
1 parent 2b0a734 commit 188c3e2
Show file tree
Hide file tree
Showing 3 changed files with 441 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sonar.test.inclusions = src/**/*.spec.*

# Exclude test and generated subdirectories from source scope
sonar.exclusions = src/**/*.spec.*
sonar.coverage.exclusions = src/**/*.stories.*,src/tests/setupTests.ts,src/tests/factories/**,src/tests/utils/**,
sonar.coverage.exclusions = src/**/*.stories.*,src/tests/setupTests.ts,src/tests/factories/**,src/tests/utils/**,src/utils/storybook.tsx,
Original file line number Diff line number Diff line change
@@ -0,0 +1,368 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`TenantMembersList: Component should render list of memberships 1`] = `
<div>
<div
class="w-full overflow-auto"
>
<table
class="w-full caption-bottom text-sm"
>
<thead
class="[&_tr]:border-b"
>
<tr
class="hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors"
>
<th
class="text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0"
>
Username
</th>
<th
class="text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0"
>
Role
</th>
<th
class="text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0"
>
Invitation accepted
</th>
<th
class="text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0"
>
Actions
</th>
</tr>
</thead>
<tbody
class="[&_tr:last-child]:border-0"
>
<tr
class="hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors"
>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
testFirstName testLastName
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
Owner
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<div
class="flex items-center"
>
<svg
class="mr-2 w-4 h-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"
/>
<circle
cx="9"
cy="7"
r="4"
/>
<polyline
points="16 11 18 13 22 9"
/>
</svg>
Yes
</div>
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<button
aria-expanded="false"
aria-haspopup="menu"
class="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background hover:bg-accent hover:text-accent-foreground h-8 w-8 p-0"
data-state="closed"
id="radix-:r0:"
type="button"
>
<svg
class="h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<circle
cx="12"
cy="9"
r="1"
/>
<circle
cx="19"
cy="9"
r="1"
/>
<circle
cx="5"
cy="9"
r="1"
/>
<circle
cx="12"
cy="15"
r="1"
/>
<circle
cx="19"
cy="15"
r="1"
/>
<circle
cx="5"
cy="15"
r="1"
/>
</svg>
</button>
</td>
</tr>
<tr
class="hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors"
>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
Firstname 1 Firstname 1
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
Admin
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<div
class="flex items-center"
>
<svg
class="mr-2 w-4 h-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"
/>
<circle
cx="9"
cy="7"
r="4"
/>
<polyline
points="16 11 18 13 22 9"
/>
</svg>
Yes
</div>
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<button
aria-expanded="false"
aria-haspopup="menu"
class="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background hover:bg-accent hover:text-accent-foreground h-8 w-8 p-0"
data-state="closed"
id="radix-:r2:"
type="button"
>
<svg
class="h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<circle
cx="12"
cy="9"
r="1"
/>
<circle
cx="19"
cy="9"
r="1"
/>
<circle
cx="5"
cy="9"
r="1"
/>
<circle
cx="12"
cy="15"
r="1"
/>
<circle
cx="19"
cy="15"
r="1"
/>
<circle
cx="5"
cy="15"
r="1"
/>
</svg>
</button>
</td>
</tr>
<tr
class="hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors"
>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
[email protected]
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
Member
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<div
class="flex items-center"
>
<svg
class="mr-2 w-4 h-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5 22h14"
/>
<path
d="M5 2h14"
/>
<path
d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"
/>
<path
d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"
/>
</svg>
No
</div>
</td>
<td
class="p-4 align-middle [&:has([role=checkbox])]:pr-0"
>
<button
aria-expanded="false"
aria-haspopup="menu"
class="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background hover:bg-accent hover:text-accent-foreground h-8 w-8 p-0"
data-state="closed"
id="radix-:r4:"
type="button"
>
<svg
class="h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<circle
cx="12"
cy="9"
r="1"
/>
<circle
cx="19"
cy="9"
r="1"
/>
<circle
cx="5"
cy="9"
r="1"
/>
<circle
cx="12"
cy="15"
r="1"
/>
<circle
cx="19"
cy="15"
r="1"
/>
<circle
cx="5"
cy="15"
r="1"
/>
</svg>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div
aria-label="Notifications (F8)"
role="region"
style="pointer-events: none;"
tabindex="-1"
>
<ol
class="fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"
data-testid="toaster"
tabindex="-1"
/>
</div>
</div>
`;
Loading

0 comments on commit 188c3e2

Please sign in to comment.