-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
381 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Admonition from "components/Admonition" | ||
import { render } from '@testing-library/preact' | ||
|
||
describe(`Admonition`, () => { | ||
it(`should render without errors`, () => { | ||
const tree = render( | ||
<Admonition title="Warning"> | ||
<p> | ||
Fun will now commence | ||
</p> | ||
</Admonition>, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import AnimatedLoading from 'components/AnimatedLoading' | ||
import { render } from '@testing-library/preact' | ||
|
||
describe(`AnimatedLoading`, () => { | ||
it(`should render without errors`, () => { | ||
const tree = render( | ||
<AnimatedLoading />, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import SelectInput from "components/SelectInput" | ||
import { render } from '@testing-library/preact' | ||
|
||
const OPTIONS = [ | ||
{ content: `Jack Cloth`, value: `cloth` }, | ||
{ content: `Anne Oldman`, value: `oldman` }, | ||
{ content: `Tom Boss`, value: `boss` }, | ||
{ content: `Asap Qureshi`, value: `qureshi` }, | ||
] | ||
|
||
const ON_CHANGE = jest.fn() | ||
|
||
describe(`SelectInput`, () => { | ||
|
||
it(`should render without errors`, () => { | ||
const tree = render( | ||
<SelectInput | ||
options={OPTIONS} | ||
value={OPTIONS[0].value} | ||
onChange={ON_CHANGE} | ||
defaultValue={OPTIONS[0].value} | ||
/>, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
114 changes: 114 additions & 0 deletions
114
src/components/__tests__/__snapshots__/Admonition.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Admonition should render without errors 1`] = ` | ||
Object { | ||
"asFragment": [Function], | ||
"baseElement": <body> | ||
<div> | ||
<div | ||
class="border border-solid border-gray-400 px-2 py-1 flex flex-row hover:bg-gray-100 cursor-pointer hover:bg-100" | ||
> | ||
<div | ||
class="grow" | ||
> | ||
<div | ||
class="inline-flex flex-row" | ||
> | ||
<strong> | ||
Warning | ||
</strong> | ||
</div> | ||
<div> | ||
<p> | ||
Fun will now commence | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="cursor-pointer text-xs p-1" | ||
> | ||
✕ | ||
</div> | ||
</div> | ||
</div> | ||
</body>, | ||
"container": <div> | ||
<div | ||
class="border border-solid border-gray-400 px-2 py-1 flex flex-row hover:bg-gray-100 cursor-pointer hover:bg-100" | ||
> | ||
<div | ||
class="grow" | ||
> | ||
<div | ||
class="inline-flex flex-row" | ||
> | ||
<strong> | ||
Warning | ||
</strong> | ||
</div> | ||
<div> | ||
<p> | ||
Fun will now commence | ||
</p> | ||
</div> | ||
</div> | ||
<div | ||
class="cursor-pointer text-xs p-1" | ||
> | ||
✕ | ||
</div> | ||
</div> | ||
</div>, | ||
"debug": [Function], | ||
"findAllByAltText": [Function], | ||
"findAllByDisplayValue": [Function], | ||
"findAllByLabelText": [Function], | ||
"findAllByPlaceholderText": [Function], | ||
"findAllByRole": [Function], | ||
"findAllByTestId": [Function], | ||
"findAllByText": [Function], | ||
"findAllByTitle": [Function], | ||
"findByAltText": [Function], | ||
"findByDisplayValue": [Function], | ||
"findByLabelText": [Function], | ||
"findByPlaceholderText": [Function], | ||
"findByRole": [Function], | ||
"findByTestId": [Function], | ||
"findByText": [Function], | ||
"findByTitle": [Function], | ||
"getAllByAltText": [Function], | ||
"getAllByDisplayValue": [Function], | ||
"getAllByLabelText": [Function], | ||
"getAllByPlaceholderText": [Function], | ||
"getAllByRole": [Function], | ||
"getAllByTestId": [Function], | ||
"getAllByText": [Function], | ||
"getAllByTitle": [Function], | ||
"getByAltText": [Function], | ||
"getByDisplayValue": [Function], | ||
"getByLabelText": [Function], | ||
"getByPlaceholderText": [Function], | ||
"getByRole": [Function], | ||
"getByTestId": [Function], | ||
"getByText": [Function], | ||
"getByTitle": [Function], | ||
"queryAllByAltText": [Function], | ||
"queryAllByDisplayValue": [Function], | ||
"queryAllByLabelText": [Function], | ||
"queryAllByPlaceholderText": [Function], | ||
"queryAllByRole": [Function], | ||
"queryAllByTestId": [Function], | ||
"queryAllByText": [Function], | ||
"queryAllByTitle": [Function], | ||
"queryByAltText": [Function], | ||
"queryByDisplayValue": [Function], | ||
"queryByLabelText": [Function], | ||
"queryByPlaceholderText": [Function], | ||
"queryByRole": [Function], | ||
"queryByTestId": [Function], | ||
"queryByText": [Function], | ||
"queryByTitle": [Function], | ||
"rerender": [Function], | ||
"unmount": [Function], | ||
} | ||
`; |
98 changes: 98 additions & 0 deletions
98
src/components/__tests__/__snapshots__/AnimatedLoading.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AnimatedLoading should render without errors 1`] = ` | ||
Object { | ||
"asFragment": [Function], | ||
"baseElement": <body> | ||
<div> | ||
<div | ||
class="inline-flex flex-row items-center" | ||
> | ||
<div | ||
class="ml-[0.2rem]" | ||
> | ||
Loading... | ||
</div> | ||
<div | ||
class="inline-block relative w-[80px] h-[10px] loading-container" | ||
> | ||
<div /> | ||
<div /> | ||
<div /> | ||
<div /> | ||
</div> | ||
</div> | ||
</div> | ||
</body>, | ||
"container": <div> | ||
<div | ||
class="inline-flex flex-row items-center" | ||
> | ||
<div | ||
class="ml-[0.2rem]" | ||
> | ||
Loading... | ||
</div> | ||
<div | ||
class="inline-block relative w-[80px] h-[10px] loading-container" | ||
> | ||
<div /> | ||
<div /> | ||
<div /> | ||
<div /> | ||
</div> | ||
</div> | ||
</div>, | ||
"debug": [Function], | ||
"findAllByAltText": [Function], | ||
"findAllByDisplayValue": [Function], | ||
"findAllByLabelText": [Function], | ||
"findAllByPlaceholderText": [Function], | ||
"findAllByRole": [Function], | ||
"findAllByTestId": [Function], | ||
"findAllByText": [Function], | ||
"findAllByTitle": [Function], | ||
"findByAltText": [Function], | ||
"findByDisplayValue": [Function], | ||
"findByLabelText": [Function], | ||
"findByPlaceholderText": [Function], | ||
"findByRole": [Function], | ||
"findByTestId": [Function], | ||
"findByText": [Function], | ||
"findByTitle": [Function], | ||
"getAllByAltText": [Function], | ||
"getAllByDisplayValue": [Function], | ||
"getAllByLabelText": [Function], | ||
"getAllByPlaceholderText": [Function], | ||
"getAllByRole": [Function], | ||
"getAllByTestId": [Function], | ||
"getAllByText": [Function], | ||
"getAllByTitle": [Function], | ||
"getByAltText": [Function], | ||
"getByDisplayValue": [Function], | ||
"getByLabelText": [Function], | ||
"getByPlaceholderText": [Function], | ||
"getByRole": [Function], | ||
"getByTestId": [Function], | ||
"getByText": [Function], | ||
"getByTitle": [Function], | ||
"queryAllByAltText": [Function], | ||
"queryAllByDisplayValue": [Function], | ||
"queryAllByLabelText": [Function], | ||
"queryAllByPlaceholderText": [Function], | ||
"queryAllByRole": [Function], | ||
"queryAllByTestId": [Function], | ||
"queryAllByText": [Function], | ||
"queryAllByTitle": [Function], | ||
"queryByAltText": [Function], | ||
"queryByDisplayValue": [Function], | ||
"queryByLabelText": [Function], | ||
"queryByPlaceholderText": [Function], | ||
"queryByRole": [Function], | ||
"queryByTestId": [Function], | ||
"queryByText": [Function], | ||
"queryByTitle": [Function], | ||
"rerender": [Function], | ||
"unmount": [Function], | ||
} | ||
`; |
Oops, something went wrong.