-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
23 changed files
with
211 additions
and
201 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
122 changes: 52 additions & 70 deletions
122
examples/typescript/src/pages/Home/__tests__/__snapshots__/home.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 |
---|---|---|
@@ -1,79 +1,61 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders correctly 1`] = ` | ||
<div | ||
className="main" | ||
> | ||
<h3> | ||
Hello | ||
<img | ||
src="SvgrURL" | ||
style={ | ||
{ | ||
"width": "1em", | ||
} | ||
} | ||
/> | ||
<div | ||
style={ | ||
{ | ||
"width": "1em", | ||
} | ||
} | ||
> | ||
[Mocked SVG] | ||
</div> | ||
World | ||
<a | ||
href="https://true.io" | ||
> | ||
True IO | ||
</a> | ||
<span | ||
style={ | ||
{ | ||
"display": "inline-block", | ||
"height": "10px", | ||
"width": "10px", | ||
} | ||
} | ||
> | ||
<div> | ||
<DocumentFragment> | ||
<div | ||
class="main" | ||
> | ||
<h3> | ||
Hello | ||
<img | ||
src="SvgrURL" | ||
style="width: 1em;" | ||
/> | ||
<div | ||
style="width: 1em;" | ||
> | ||
[Mocked SVG] | ||
</div> | ||
</span> | ||
</h3> | ||
<p | ||
className="mountainTop" | ||
> | ||
Ok again | ||
<img | ||
src="FileURL" | ||
/> | ||
/hi/bob/test.txt | ||
/repos/:owner/:repo/issues/:number | ||
/2/ | ||
</p> | ||
<p | ||
className="silly" | ||
> | ||
$text-color: | ||
textColor | ||
</p> | ||
<p> | ||
<img | ||
src="SvgrURL" | ||
/> | ||
</p> | ||
<code> | ||
<html> | ||
World | ||
<a | ||
href="https://true.io" | ||
> | ||
True IO | ||
</a> | ||
<span | ||
style="width: 10px; height: 10px; display: inline-block;" | ||
> | ||
<div> | ||
[Mocked SVG] | ||
</div> | ||
</span> | ||
</h3> | ||
<p | ||
class="mountainTop" | ||
> | ||
Ok again | ||
<img | ||
src="FileURL" | ||
/> | ||
/hi/bob/test.txt /repos/:owner/:repo/issues/:number /2/ | ||
</p> | ||
<p | ||
class="silly" | ||
> | ||
$text-color: textColor | ||
</p> | ||
<p> | ||
<img | ||
src="SvgrURL" | ||
/> | ||
</p> | ||
<code> | ||
<html> | ||
<body><h1>My HTML Works</h1></body> | ||
</html> | ||
</code> | ||
</div> | ||
</code> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import Home from '../index'; | ||
|
||
it('renders correctly', () => { | ||
const tree = renderer.create(<Home />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
const { asFragment } = render(<Home />); | ||
|
||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
2 changes: 1 addition & 1 deletion
2
examples/typescript/src/pages/Posts/__tests__/__snapshots__/postList.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders 1`] = `null`; | ||
exports[`renders 1`] = `<DocumentFragment />`; |
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
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import type { JSX } from 'react'; | ||
|
||
import { ServerProps } from './types.js'; | ||
|
||
const appSpout = | ||
|
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
20 changes: 9 additions & 11 deletions
20
packages/generator-js/src/anansi-splash/templates/src/__tests__/home.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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import renderer from 'react-test-renderer'; | ||
import { render } from '@testing-library/react' | ||
import { DataProvider, AsyncBoundary } from '@data-client/react'; | ||
import { mockInitialState } from '@data-client/test'; | ||
|
||
import { TickerFixtures } from '@/resources/Ticker'; | ||
import Home from '@/pages/Home'; | ||
|
||
it('renders correctly', () => { | ||
const tree = renderer | ||
.create( | ||
<DataProvider initialState={mockInitialState([TickerFixtures.get])}> | ||
<AsyncBoundary> | ||
<Home /> | ||
</AsyncBoundary> | ||
</DataProvider>, | ||
) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
const { asFragment } = render( | ||
<DataProvider initialState={mockInitialState([TickerFixtures.get])}> | ||
<AsyncBoundary> | ||
<Home /> | ||
</AsyncBoundary> | ||
</DataProvider> | ||
); | ||
expect(asFragment()).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
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
Oops, something went wrong.