forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rudimentary tests for not covered entry points (facebook#11835)
* Add basic snapshot tests to ReactART components (Circle, Rectangle, Wedge) * More tests on Circle, Rectangle, Wedge * linc warning fixes * - remove tests to Wedge component internal function * More test on Wedge component, update snapshots
- Loading branch information
1 parent
a291cf9
commit ccda776
Showing
5 changed files
with
212 additions
and
0 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,14 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const Circle = require('./npm/Circle'); | ||
|
||
module.exports = Circle; |
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,14 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const Rectangle = require('./npm/Rectangle'); | ||
|
||
module.exports = Rectangle; |
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,14 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const Wedge = require('./npm/Wedge'); | ||
|
||
module.exports = Wedge; |
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
77 changes: 77 additions & 0 deletions
77
packages/react-art/src/__tests__/__snapshots__/ReactART-test.js.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,77 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ReactARTComponents should generate a <Shape> with props for drawing the Circle 1`] = ` | ||
<Shape | ||
d={ | ||
{ | ||
"_pivotX": 0, | ||
"_pivotY": -10, | ||
"path": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
"penDownX": null, | ||
"penDownY": -10, | ||
"penX": 0, | ||
"penY": -10, | ||
} | ||
} | ||
fill="blue" | ||
radius={10} | ||
stroke="green" | ||
strokeWidth={3} | ||
/> | ||
`; | ||
exports[`ReactARTComponents should generate a <Shape> with props for drawing the Rectangle 1`] = ` | ||
<Shape | ||
d={ | ||
{ | ||
"_pivotX": 0, | ||
"_pivotY": 0, | ||
"path": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
"penDownX": 0, | ||
"penDownY": 0, | ||
"penX": 0, | ||
"penY": 0, | ||
} | ||
} | ||
fill="blue" | ||
height={50} | ||
stroke="green" | ||
width={50} | ||
/> | ||
`; | ||
exports[`ReactARTComponents should generate a <Shape> with props for drawing the Wedge 1`] = ` | ||
<Shape | ||
d={ | ||
{ | ||
"_pivotX": 0, | ||
"_pivotY": 50, | ||
"path": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
"penDownX": null, | ||
"penDownY": 50, | ||
"penX": 0, | ||
"penY": 50, | ||
} | ||
} | ||
endAngle={360} | ||
fill="blue" | ||
outerRadius={50} | ||
startAngle={0} | ||
/> | ||
`; |