forked from DylanVann/react-native-fast-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFastImage.test.js
38 lines (33 loc) · 895 Bytes
/
FastImage.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { StyleSheet } from 'react-native'
import React from 'react'
import renderer from 'react-test-renderer'
import FastImage from './FastImage.js'
const style = StyleSheet.create({ image: { width: 44, height: 44 } })
test('FastImage renders correctly.', () => {
const tree = renderer
.create(
<FastImage
source={{
uri: 'https://facebook.github.io/react/img/logo_og.png',
headers: {
token: 'someToken',
},
priority: FastImage.priority.high,
}}
style={style.image}
/>,
)
.toJSON()
expect(tree).toMatchSnapshot()
})
test('Renders a normal Image when not passed a uri.', () => {
const tree = renderer
.create(
<FastImage
source={require('./server/pictures/jellyfish.gif')}
style={style.image}
/>,
)
.toJSON()
expect(tree).toMatchSnapshot()
})