chore: Test fallback prop. (#413)

This commit is contained in:
Dylan Vann 2019-02-22 00:10:33 -05:00 committed by GitHub
parent c3492fc334
commit f4696c26b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 645 additions and 469 deletions

View File

@ -37,16 +37,16 @@
}
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/core": "^7.3.3",
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/git": "^7.0.7",
"@semantic-release/npm": "^5.1.3",
"@semantic-release/release-notes-generator": "^7.1.4",
"babel-jest": "^23.6.0",
"babel-jest": "^24.1.0",
"commitizen": "^3.0.5",
"cz-conventional-changelog": "^2.1.0",
"jest": "^23.6.0",
"jest": "^24.1.0",
"metro-react-native-babel-preset": "0.48.1",
"prettier": "^1.15.3",
"prettier-check": "^2.0.0",

View File

@ -38,6 +38,40 @@ exports[`FastImage renders correctly. 1`] = `
</View>
`;
exports[`Renders Image with fallback prop. 1`] = `
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"height": 44,
"width": 44,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"testUri": "../../../react-native-fast-image-example-server/pictures/jellyfish.gif",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
`;
exports[`Renders a normal Image when not passed a uri. 1`] = `
<View
style={

View File

@ -36,3 +36,17 @@ test('Renders a normal Image when not passed a uri.', () => {
expect(tree).toMatchSnapshot()
})
test('Renders Image with fallback prop.', () => {
const tree = renderer
.create(
<FastImage
source={require('../react-native-fast-image-example-server/pictures/jellyfish.gif')}
style={style.image}
fallback
/>,
)
.toJSON()
expect(tree).toMatchSnapshot()
})

1060
yarn.lock

File diff suppressed because it is too large Load Diff