Skip to content

Commit

Permalink
feat: add test for trailStrokeWidth mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
MathewtheCoder committed Feb 7, 2021
1 parent c398b3e commit 67542b1
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/mobile/__tests__/CountdownCircleTimer.test.js
Expand Up @@ -80,6 +80,18 @@ describe('snapshot tests', () => {

expect(tree).toMatchSnapshot()
})

it('renders with different trail stroke width', () => {
const tree = renderer
.create(
<CountdownCircleTimer {...fixture} trailStrokeWidth={16} strokeWidth={14}>
{({ remainingTime }) => <Text>{remainingTime}</Text>}
</CountdownCircleTimer>
)
.toJSON()

expect(tree).toMatchSnapshot()
})
})

describe('functional tests', () => {
Expand Down
Expand Up @@ -79,6 +79,105 @@ exports[`snapshot tests renders 1`] = `
</View>
`;

exports[`snapshot tests renders with different trail stroke width 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,7
a 83,83 0 1,0 0,166
a 83,83 0 1,0 0,-166"
fill={null}
propList={
Array [
"fill",
"stroke",
"strokeWidth",
]
}
stroke={4292467161}
strokeWidth={16}
/>
<RNSVGPath
d="m 90,7
a 83,83 0 1,0 0,166
a 83,83 0 1,0 0,-166"
fill={null}
propList={
Array [
"fill",
"stroke",
"strokeWidth",
"strokeDasharray",
"strokeDashoffset",
"strokeLinecap",
]
}
stroke={4278208375}
strokeDasharray={
Array [
521.5043804959057,
521.5043804959057,
]
}
strokeDashoffset={null}
strokeLinecap={1}
strokeWidth={14}
/>
</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>
</View>
`;

exports[`snapshot tests renders with gradient 1`] = `
<View
accessibilityLabel="Countdown timer"
Expand Down

0 comments on commit 67542b1

Please sign in to comment.