-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: rename packages name and add tests for the Mobile packge
- Loading branch information
1 parent
49fd34a
commit 82c7c3b
Showing
42 changed files
with
267 additions
and
35 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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,35 @@ | ||
import React from 'react' | ||
import { Text } from 'react-native' | ||
import renderer from 'react-test-renderer' | ||
|
||
import { CountdownCircleTimer } from '../src' | ||
|
||
Math.random = () => 0.124578 | ||
|
||
const fixture = { | ||
duration: 10, | ||
colors: [['#004777', 0.33], ['#F7B801', 0.33], ['#A30000']], | ||
} | ||
|
||
describe('snapshot tests', () => { | ||
it('renders', () => { | ||
const tree = renderer.create(<CountdownCircleTimer {...fixture} />).toJSON() | ||
|
||
expect(tree).toMatchSnapshot() | ||
}) | ||
|
||
it('renders with time', () => { | ||
const tree = renderer | ||
.create( | ||
<CountdownCircleTimer | ||
{...fixture} | ||
renderAriaTime={({ remainingTime }) => remainingTime} | ||
> | ||
{({ remainingTime }) => <Text>{remainingTime}</Text>} | ||
</CountdownCircleTimer> | ||
) | ||
.toJSON() | ||
|
||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
192 changes: 192 additions & 0 deletions
192
packages/mobile/__tests__/__snapshots__/CountdownCircleTimer.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,192 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snapshot tests renders 1`] = ` | ||
<View | ||
accessibilityLabel="Countdown timer" | ||
accessible={true} | ||
style={ | ||
Object { | ||
"height": 180, | ||
"position": "relative", | ||
"width": 180, | ||
} | ||
} | ||
> | ||
<RNSVGSvgView | ||
bbHeight={180} | ||
bbWidth={180} | ||
focusable={false} | ||
height={180} | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "transparent", | ||
"borderWidth": 0, | ||
}, | ||
Object { | ||
"flex": 0, | ||
"height": 180, | ||
"width": 180, | ||
}, | ||
] | ||
} | ||
width={180} | ||
> | ||
<RNSVGGroup> | ||
<RNSVGPath | ||
d="m 90,6 | ||
a 84,84 0 1,0 0,168 | ||
a 84,84 0 1,0 0,-168" | ||
fill={null} | ||
propList={ | ||
Array [ | ||
"fill", | ||
"stroke", | ||
"strokeWidth", | ||
] | ||
} | ||
stroke={4292467161} | ||
strokeWidth={12} | ||
/> | ||
<RNSVGPath | ||
d="m 90,6 | ||
a 84,84 0 1,0 0,168 | ||
a 84,84 0 1,0 0,-168" | ||
fill={null} | ||
propList={ | ||
Array [ | ||
"fill", | ||
"stroke", | ||
"strokeWidth", | ||
"strokeDasharray", | ||
"strokeDashoffset", | ||
"strokeLinecap", | ||
] | ||
} | ||
stroke={4278208375} | ||
strokeDasharray={ | ||
Array [ | ||
527.7875658030853, | ||
527.7875658030853, | ||
] | ||
} | ||
strokeDashoffset={null} | ||
strokeLinecap={1} | ||
strokeWidth={12} | ||
/> | ||
</RNSVGGroup> | ||
</RNSVGSvgView> | ||
</View> | ||
`; | ||
|
||
exports[`snapshot tests renders with time 1`] = ` | ||
<View | ||
accessibilityLabel="Countdown timer" | ||
accessible={true} | ||
style={ | ||
Object { | ||
"height": 180, | ||
"position": "relative", | ||
"width": 180, | ||
} | ||
} | ||
> | ||
<RNSVGSvgView | ||
bbHeight={180} | ||
bbWidth={180} | ||
focusable={false} | ||
height={180} | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "transparent", | ||
"borderWidth": 0, | ||
}, | ||
Object { | ||
"flex": 0, | ||
"height": 180, | ||
"width": 180, | ||
}, | ||
] | ||
} | ||
width={180} | ||
> | ||
<RNSVGGroup> | ||
<RNSVGPath | ||
d="m 90,6 | ||
a 84,84 0 1,0 0,168 | ||
a 84,84 0 1,0 0,-168" | ||
fill={null} | ||
propList={ | ||
Array [ | ||
"fill", | ||
"stroke", | ||
"strokeWidth", | ||
] | ||
} | ||
stroke={4292467161} | ||
strokeWidth={12} | ||
/> | ||
<RNSVGPath | ||
d="m 90,6 | ||
a 84,84 0 1,0 0,168 | ||
a 84,84 0 1,0 0,-168" | ||
fill={null} | ||
propList={ | ||
Array [ | ||
"fill", | ||
"stroke", | ||
"strokeWidth", | ||
"strokeDasharray", | ||
"strokeDashoffset", | ||
"strokeLinecap", | ||
] | ||
} | ||
stroke={4278208375} | ||
strokeDasharray={ | ||
Array [ | ||
527.7875658030853, | ||
527.7875658030853, | ||
] | ||
} | ||
strokeDashoffset={null} | ||
strokeLinecap={1} | ||
strokeWidth={12} | ||
/> | ||
</RNSVGGroup> | ||
</RNSVGSvgView> | ||
<View | ||
accessibilityElementsHidden={true} | ||
importantForAccessibility="no-hide-descendants" | ||
style={ | ||
Object { | ||
"alignItems": "center", | ||
"display": "flex", | ||
"height": "100%", | ||
"justifyContent": "center", | ||
"left": 0, | ||
"position": "absolute", | ||
"top": 0, | ||
"width": "100%", | ||
} | ||
} | ||
> | ||
<Text> | ||
10 | ||
</Text> | ||
</View> | ||
<Text | ||
accessibilityLiveRegion="assertive" | ||
accessibilityRole="timer" | ||
importantForAccessibility="yes" | ||
style={ | ||
Object { | ||
"height": 0, | ||
"opacity": 0, | ||
} | ||
} | ||
> | ||
10 | ||
</Text> | ||
</View> | ||
`; |
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,9 @@ | ||
module.exports = { | ||
preset: 'react-native', | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(react-native|react-native-svg)/)', | ||
], | ||
transform: { | ||
'^.+\\.(js|jsx)$': 'babel-jest', | ||
}, | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ges/mobile-react-native/webpack.config.js → packages/mobile/webpack.config.js
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
const webpackBaseConfig = require('../../webpack-base-config') | ||
|
||
module.exports = webpackBaseConfig |
File renamed without changes.
Oops, something went wrong.