Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bricks666 committed Aug 25, 2024
1 parent 8ccec54 commit 45301b4
Show file tree
Hide file tree
Showing 40 changed files with 599 additions and 782 deletions.
10 changes: 7 additions & 3 deletions configs/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { expect, afterEach, beforeAll, afterAll, vi } from 'vitest';
import { cleanup } from '@testing-library/react';
import * as matchers from '@testing-library/jest-dom/matchers';
import { matchMedia, MediaQueryListEvent } from 'mock-match-media';
import { server, cleanup as cleanupMatchMedia } from '~/test-utils';
import {
matchMedia,
MediaQueryListEvent,
cleanup as cleanupMatchMedia,
} from 'mock-match-media';
import { server } from '~/test-utils';

expect.extend(matchers);

Expand All @@ -23,8 +27,8 @@ beforeAll(() => {

afterEach(() => {
cleanup();
cleanupMatchMedia();
server.resetHandlers();
cleanupMatchMedia();
});

afterAll(() => {
Expand Down

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions src/features/auth/login/__snapshots__/ui.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
exports[`features/auth/login/ui > should render form, 3 inputs and button 1`] = `
<form
aria-label="login_form.title"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 _form_97cd14 _form_2bca9b css-1ps6pg7-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 _form_97cd14 _form_2bca9b css-hpo018-MuiPaper-root"
>
<div
class="MuiFormControl-root MuiTextField-root _field_2bca9b css-1u3bzj6-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1p1nhed-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r0:"
id=":r0:-label"
>
login_form.fields.email
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl css-9ddj71-MuiInputBase-root-MuiOutlinedInput-root"
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl css-6wnkke-MuiInputBase-root-MuiOutlinedInput-root"
>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input"
class="MuiInputBase-input MuiOutlinedInput-input css-1gjhcy5-MuiInputBase-input-MuiOutlinedInput-input"
id=":r0:"
name="email"
type="text"
value=""
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
class="MuiOutlinedInput-notchedOutline css-jnltum-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-yjsfm1"
Expand All @@ -45,29 +45,29 @@ exports[`features/auth/login/ui > should render form, 3 inputs and button 1`] =
class="MuiFormControl-root MuiTextField-root _field_2bca9b css-1u3bzj6-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1p1nhed-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r1:"
id=":r1:-label"
>
login_form.fields.password
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-adornedEnd css-o9k5xi-MuiInputBase-root-MuiOutlinedInput-root"
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-formControl MuiInputBase-adornedEnd css-fliaa7-MuiInputBase-root-MuiOutlinedInput-root"
>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd css-nxo287-MuiInputBase-input-MuiOutlinedInput-input"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedEnd css-1mv6xrr-MuiInputBase-input-MuiOutlinedInput-input"
id=":r1:"
name="password"
type="password"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1t3qds-MuiInputAdornment-root"
>
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-78trlr-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-1ccnvf0-MuiButtonBase-root-MuiIconButton-root"
tabindex="0"
type="button"
>
Expand All @@ -89,7 +89,7 @@ exports[`features/auth/login/ui > should render form, 3 inputs and button 1`] =
</div>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
class="MuiOutlinedInput-notchedOutline css-jnltum-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-yjsfm1"
Expand All @@ -102,10 +102,10 @@ exports[`features/auth/login/ui > should render form, 3 inputs and button 1`] =
</div>
</div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-j204z7-MuiFormControlLabel-root"
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-1g3g8d2-MuiFormControlLabel-root"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-17qvps1-MuiButtonBase-root-MuiCheckbox-root"
>
<input
class="PrivateSwitchBase-input css-1m9pwf3"
Expand Down Expand Up @@ -136,7 +136,7 @@ exports[`features/auth/login/ui > should render form, 3 inputs and button 1`] =
</span>
</label>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium css-1e6y48t-MuiButtonBase-root-MuiButton-root"
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium css-15qnkk1-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="submit"
>
Expand Down
20 changes: 10 additions & 10 deletions src/features/auth/logout/__snapshots__/profile-menu.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ exports[`features/auth/logout/profile-menu > should render button when menu is c
<div>
<button
aria-label="profile_menu.title"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-78trlr-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-1ccnvf0-MuiButtonBase-root-MuiIconButton-root"
data-mui-internal-clone-element="true"
tabindex="0"
type="button"
>
<div
aria-label="username"
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1f5h5jw-MuiAvatar-root"
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1i3y8b0-MuiAvatar-root"
data-mui-internal-clone-element="true"
>
<svg
Expand Down Expand Up @@ -47,14 +47,14 @@ exports[`features/auth/logout/profile-menu > should render button when menu is n
<div>
<button
aria-label="profile_menu.title"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-78trlr-MuiButtonBase-root-MuiIconButton-root"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-1ccnvf0-MuiButtonBase-root-MuiIconButton-root"
data-mui-internal-clone-element="true"
tabindex="0"
type="button"
>
<div
aria-label="username"
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1f5h5jw-MuiAvatar-root"
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1i3y8b0-MuiAvatar-root"
data-mui-internal-clone-element="true"
>
<svg
Expand All @@ -76,7 +76,7 @@ exports[`features/auth/logout/profile-menu > should render button when menu is n
</div>
</div>
<div
class="MuiMenu-root MuiPopover-root MuiModal-root css-10nakn3-MuiModal-root-MuiPopover-root-MuiMenu-root"
class="MuiMenu-root MuiPopover-root MuiModal-root css-28lyyy-MuiModal-root-MuiPopover-root-MuiMenu-root"
role="presentation"
>
<div
Expand All @@ -89,7 +89,7 @@ exports[`features/auth/logout/profile-menu > should render button when menu is n
tabindex="0"
/>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation8 MuiMenu-paper MuiPopover-paper MuiMenu-paper css-3dzjca-MuiPaper-root-MuiPopover-paper-MuiMenu-paper"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation8 MuiMenu-paper MuiPopover-paper MuiMenu-paper css-u2vwkl-MuiPaper-root-MuiPopover-paper-MuiMenu-paper"
style="opacity: 1; transform: scale(1, 1); transition: opacity 0ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,transform 0ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; top: 16px; left: 16px; transform-origin: -16px -16px;"
tabindex="-1"
>
Expand All @@ -99,12 +99,12 @@ exports[`features/auth/logout/profile-menu > should render button when menu is n
tabindex="-1"
>
<li
class="MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-kk1bwy-MuiButtonBase-root-MuiMenuItem-root"
class="MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-ztq8a6-MuiButtonBase-root-MuiMenuItem-root"
role="menuitem"
tabindex="-1"
>
<div
class="MuiListItemIcon-root css-cveggr-MuiListItemIcon-root"
class="MuiListItemIcon-root css-11tpveg-MuiListItemIcon-root"
>
<svg
aria-hidden="true"
Expand All @@ -124,12 +124,12 @@ exports[`features/auth/logout/profile-menu > should render button when menu is n
/>
</li>
<li
class="MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-kk1bwy-MuiButtonBase-root-MuiMenuItem-root"
class="MuiButtonBase-root MuiMenuItem-root MuiMenuItem-gutters MuiMenuItem-root MuiMenuItem-gutters css-ztq8a6-MuiButtonBase-root-MuiMenuItem-root"
role="menuitem"
tabindex="-1"
>
<div
class="MuiListItemIcon-root css-cveggr-MuiListItemIcon-root"
class="MuiListItemIcon-root css-11tpveg-MuiListItemIcon-root"
>
<svg
aria-hidden="true"
Expand Down
Loading

0 comments on commit 45301b4

Please sign in to comment.