-
Notifications
You must be signed in to change notification settings - Fork 18
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
13 changed files
with
8,728 additions
and
3,544 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defaults } from 'jest-config'; | ||
|
||
export default { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', | ||
"^.+\\.svg$": "<rootDir>/svgTransform.ts" | ||
}, | ||
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', | ||
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'], | ||
roots: ["<rootDir>/src"], | ||
setupFilesAfterEnv: [ | ||
"@testing-library/jest-dom/extend-expect" | ||
], | ||
moduleNameMapper: { | ||
"\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules", | ||
'^@backend/(.*)$': '<rootDir>/../server/src/api/$1', | ||
}, | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
client/src/components/EditableText/__test__/__snapshots__/index.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,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<EditableText /> Matches snapshot 1`] = ` | ||
<div | ||
class="editable-text" | ||
> | ||
<p | ||
class="editable-text__title" | ||
> | ||
test text | ||
<i | ||
class="fas fa-pencil-alt editable-text__icon" | ||
/> | ||
</p> | ||
</div> | ||
`; |
21 changes: 21 additions & 0 deletions
21
client/src/components/EditableText/__test__/index.test.tsx
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,21 @@ | ||
// Packages | ||
import * as React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
// Project | ||
import EditableText from '../index'; | ||
|
||
|
||
describe('<EditableText />', () => { | ||
it('Matches snapshot', () => { | ||
const { container } = render( | ||
<EditableText | ||
text="test text" | ||
tag="p" | ||
onSuccess={jest.fn()} | ||
/> | ||
); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
client/src/components/Loading/__test__/__snapshots__/index.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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Loading /> Matches snapshot 1`] = ` | ||
<div | ||
class="loading" | ||
> | ||
<img | ||
src="[object Object]" | ||
/> | ||
</div> | ||
`; |
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,24 @@ | ||
// Packages | ||
import * as React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
// Project | ||
import Loading from '../index'; | ||
|
||
|
||
describe('<Loading />', () => { | ||
it('Matches snapshot', () => { | ||
const { container } = render( | ||
<Loading display /> | ||
); | ||
|
||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
|
||
it('Not visible when false display prop', () => { | ||
const { container } = render( | ||
<Loading /> | ||
); | ||
expect(container.firstChild).toHaveClass('loading--hidden'); | ||
}); | ||
}); |
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
Empty file.
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 @@ | ||
import '@testing-library/jest-dom/extend-expect' |
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,8 @@ | ||
module.exports = { | ||
process() { | ||
return 'module.exports = {};'; | ||
}, | ||
getCacheKey() { | ||
return 'svgTransform'; | ||
}, | ||
} |
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