Skip to content

Commit

Permalink
feat: update jest-setup.js and change some title on the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-goupil committed Jul 18, 2024
1 parent 18bcc6b commit 888bcaf
Show file tree
Hide file tree
Showing 33 changed files with 68 additions and 68 deletions.
1 change: 1 addition & 0 deletions packages/components/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
// used for __tests__/testing-library.js
// learn more: https://github.com/testing-library/jest-dom
import '@inrupt/jest-jsdom-polyfills'
import '@testing-library/jest-dom/extend-expect'
// import '@testing-library/jest-dom/extend-expect'
// import 'core-js/stable'
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { renderWithProviders } from '../../../utils/tests'

import Checkbox from './Checkbox'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('CheckboxError', () => {
describe('Checkbox', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(<Checkbox label="Label" value />)
expect(container).toMatchSnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,43 @@ import { renderWithProviders } from '../../../utils/tests'

import CheckboxWithoutError from './CheckboxWithoutError'

describe('Checkbox match snapshot', () => {
it('CheckboxIndeterminateFalse', () => {
describe('CheckboxWithoutError match snapshot', () => {
it('CheckboxWithoutErrorIndeterminateFalse', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate={false} />
)
expect(container).toMatchSnapshot()
})

it('CheckboxIndeterminateTrue', () => {
it('CheckboxWithoutErrorIndeterminateTrue', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate />
)
expect(container).toMatchSnapshot()
})

it('CheckboxLabelAndList', () => {
it('CheckboxWithoutErrorLabelAndList', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate label="Label" list />
)
expect(container).toMatchSnapshot()
})

it('CheckboxLabel', () => {
it('CheckboxWithoutErrorLabel', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate={false} label="Label" />
)
expect(container).toMatchSnapshot()
})

it('CheckboxListTrue', () => {
it('CheckboxWithoutErrorListTrue', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate={false} list />
)
expect(container).toMatchSnapshot()
})

it('CheckboxListFalse', () => {
it('CheckboxWithoutErrorListFalse', () => {
const { container } = renderWithProviders(
<CheckboxWithoutError indeterminate={false} list={false} />
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DatePicker from './DatePicker'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('RangeError', () => {
describe('DatePicker', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<DatePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DoubleDatePicker from './DoubleDatePicker'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('RangeError', () => {
describe('DoubleDatePicker', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<DoubleDatePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const options = [
},
]

describe('DropDownError', () => {
describe('DropDown', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<DropDown options={options} value={1} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderWithProviders } from '../../../utils/tests'

import DropDownWithoutError from './DropDownWithoutError'

describe('DropDown match snapshot', () => {
describe('DropDownWithoutError match snapshot', () => {
it('BadgeDisabledFalse', () => {
const { container } = renderWithProviders(
<DropDownWithoutError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import InputText from './InputText'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('InputTextError', () => {
describe('InputText', () => {
it('match snapshot', () => {
const { container } = renderWithProviders(
<InputText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderWithProviders } from '../../../utils/tests'

import InputTextWithoutError from './InputTextWithoutError'

describe('InputText match snapshot', () => {
describe('InputTextWithoutError match snapshot', () => {
it('BadgeDisabledFalse', () => {
const { container } = renderWithProviders(
<InputTextWithoutError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const options = [
},
]

describe('RadioGroupError', () => {
describe('RadioGroup', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<RadioGroup options={options} value={1} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderWithProviders } from '../../../utils/tests'

import RadioGroupWithoutError from './RadioGroupWithoutError'

describe('Switch match snapshot', () => {
describe('RadioGroupWithoutError match snapshot', () => {
it('Radio group defaultChecked true with default', () => {
const { container } = renderWithProviders(
<RadioGroupWithoutError
Expand All @@ -20,7 +20,7 @@ describe('Switch match snapshot', () => {
expect(container).toMatchSnapshot()
})

it('Radio group defaultChecked true without default', () => {
it('RadioGroupWithoutError defaultChecked true without default', () => {
const { container } = renderWithProviders(
<RadioGroupWithoutError
name="radio-buttons-group"
Expand All @@ -35,7 +35,7 @@ describe('Switch match snapshot', () => {
expect(container).toMatchSnapshot()
})

it('Radio group defaultChecked False with default true', () => {
it('RadioGroupWithoutError defaultChecked False with default true', () => {
const { container } = renderWithProviders(
<RadioGroupWithoutError
name="radio-buttons-group"
Expand All @@ -50,7 +50,7 @@ describe('Switch match snapshot', () => {
expect(container).toMatchSnapshot()
})

it('Radio group defaultChecked False without default', () => {
it('RadioGroupWithoutError defaultChecked False without default', () => {
const { container } = renderWithProviders(
<RadioGroupWithoutError
name="radio-buttons-group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Range from './Range'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('RangeError', () => {
describe('Range', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<Range label="Label" value={[1, 3]} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TextFieldTags from './TextFieldTags'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('TextFieldTagsError', () => {
describe('TextFieldTags', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<TextFieldTags label="Label" value={['test']} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Textarea from './Textarea'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('TextareaError', () => {
describe('Textarea', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<Textarea label="Label" value="Test" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { renderWithProviders } from '../../../utils/tests'

import TextareaWithoutError from './TextareaWithoutError'

describe('Textarea match snapshot', () => {
it('TextareaAllFalse', () => {
describe('TextareaWithoutError match snapshot', () => {
it('TextareaWithoutErrorAllFalse', () => {
const { container } = renderWithProviders(
<TextareaWithoutError
id="textarea"
Expand All @@ -21,7 +21,7 @@ describe('Textarea match snapshot', () => {
expect(container).toMatchSnapshot()
})

it('TextareaAllTrue', () => {
it('TextareaWithoutErrorAllTrue', () => {
const { container } = renderWithProviders(
<TextareaWithoutError
id="textarea"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { categories } from '../../../../public/mocks/categories.json'
import { screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'

describe('TreeSelectorError', () => {
describe('TreeSelector', () => {
it('sould match snapshot', () => {
const { container } = renderWithProviders(
<TreeSelector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import categories from '../../../../public/mocks/categories.json'

import TextFieldTagsWithoutError from './TreeSelectorWithoutError'

describe('TreeSelector', () => {
describe('TreeSelectorWithoutError', () => {
it('should match snapshot', () => {
const { container } = renderWithProviders(
<TextFieldTagsWithoutError
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CheckboxError sould match snapshot 1`] = `
exports[`Checkbox sould match snapshot 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Checkbox match snapshot CheckboxIndeterminateFalse 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorIndeterminateFalse 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down Expand Up @@ -37,7 +37,7 @@ exports[`Checkbox match snapshot CheckboxIndeterminateFalse 1`] = `
</div>
`;

exports[`Checkbox match snapshot CheckboxIndeterminateTrue 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorIndeterminateTrue 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down Expand Up @@ -74,7 +74,7 @@ exports[`Checkbox match snapshot CheckboxIndeterminateTrue 1`] = `
</div>
`;

exports[`Checkbox match snapshot CheckboxLabel 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorLabel 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down Expand Up @@ -113,7 +113,7 @@ exports[`Checkbox match snapshot CheckboxLabel 1`] = `
</div>
`;

exports[`Checkbox match snapshot CheckboxLabelAndList 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorLabelAndList 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down Expand Up @@ -152,7 +152,7 @@ exports[`Checkbox match snapshot CheckboxLabelAndList 1`] = `
</div>
`;

exports[`Checkbox match snapshot CheckboxListFalse 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorListFalse 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down Expand Up @@ -189,7 +189,7 @@ exports[`Checkbox match snapshot CheckboxListFalse 1`] = `
</div>
`;

exports[`Checkbox match snapshot CheckboxListTrue 1`] = `
exports[`CheckboxWithoutError match snapshot CheckboxWithoutErrorListTrue 1`] = `
<div>
<label
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-fbz9fk-MuiFormControlLabel-root"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`RangeError sould match snapshot 1`] = `
exports[`DatePicker sould match snapshot 1`] = `
<div>
<div
class="MuiFormControl-root css-hh3vi8-MuiFormControl-root"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`RangeError sould match snapshot 1`] = `
exports[`DoubleDatePicker sould match snapshot 1`] = `
<div>
<div
class="css-vaijrj"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DropDownError sould match snapshot 1`] = `
exports[`DropDown sould match snapshot 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -70,7 +70,7 @@ exports[`DropDownError sould match snapshot 1`] = `
</div>
`;

exports[`DropDownError sould match snapshot width multiple value 1`] = `
exports[`DropDown sould match snapshot width multiple value 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DropDown match snapshot BadgeArrayObjectValue 1`] = `
exports[`DropDownWithoutError match snapshot BadgeArrayObjectValue 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`DropDown match snapshot BadgeArrayObjectValue 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeDisabledFalse 1`] = `
exports[`DropDownWithoutError match snapshot BadgeDisabledFalse 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -183,7 +183,7 @@ exports[`DropDown match snapshot BadgeDisabledFalse 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeDisabledTrue 1`] = `
exports[`DropDownWithoutError match snapshot BadgeDisabledTrue 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -238,7 +238,7 @@ exports[`DropDown match snapshot BadgeDisabledTrue 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeLabel 1`] = `
exports[`DropDownWithoutError match snapshot BadgeLabel 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -301,7 +301,7 @@ exports[`DropDown match snapshot BadgeLabel 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeMultiple 1`] = `
exports[`DropDownWithoutError match snapshot BadgeMultiple 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -364,7 +364,7 @@ exports[`DropDown match snapshot BadgeMultiple 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeObjectValue 1`] = `
exports[`DropDownWithoutError match snapshot BadgeObjectValue 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -441,7 +441,7 @@ exports[`DropDown match snapshot BadgeObjectValue 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeRequiredFalse 1`] = `
exports[`DropDownWithoutError match snapshot BadgeRequiredFalse 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down Expand Up @@ -497,7 +497,7 @@ exports[`DropDown match snapshot BadgeRequiredFalse 1`] = `
</div>
`;

exports[`DropDown match snapshot BadgeRequiredTrue 1`] = `
exports[`DropDownWithoutError match snapshot BadgeRequiredTrue 1`] = `
<div>
<div
class="MuiFormControl-root css-1girsym-MuiFormControl-root"
Expand Down
Loading

0 comments on commit 888bcaf

Please sign in to comment.