Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
iRoachie authored Sep 26, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 89c6c7a + a31211e commit cbeaf5f
Showing 4 changed files with 27 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 'stable'
- "stable"
cache:
yarn: true
directories:
@@ -10,6 +10,7 @@ branches:
only:
- master
- next
- patch
install:
- yarn global add codecov
- yarn
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-elements",
"version": "1.2.2",
"version": "1.2.3",
"description": "React Native Elements & UI Toolkit",
"main": "src/index.js",
"types": "src/index.d.ts",
2 changes: 1 addition & 1 deletion src/image/Image.js
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ class Image extends React.Component {
style={StyleSheet.flatten([styles.container, containerStyle])}
>
<ImageComponent
testID="RNE__Image"
{...attributes}
onLoad={this.onLoad}
style={[
@@ -59,7 +60,6 @@ class Image extends React.Component {
height: style.height,
},
]}
testID="RNE__Image"
/>

<Animated.View
23 changes: 23 additions & 0 deletions src/image/__tests__/Image.js
Original file line number Diff line number Diff line change
@@ -46,6 +46,29 @@ describe('Image Component', () => {
expect(toJson(component)).toMatchSnapshot();
});

it('should render the appropriate testId when one is passed.', () => {
const component = shallow(
<Image
testID="customTestId"
source={{ uri: 'https://i.imgur.com/0y8Ftya.jpg' }}
/>
);

const image = component.find({ testID: 'customTestId' });

expect(image.length).toBe(1);
});

it('should render the appropriate testId when one is not passed.', () => {
const component = shallow(
<Image source={{ uri: 'https://i.imgur.com/0y8Ftya.jpg' }} />
);

const image = component.find({ testID: 'RNE__Image' });

expect(image.length).toBe(1);
});

it('should apply values from theme', () => {
const theme = {
Image: {

0 comments on commit cbeaf5f

Please sign in to comment.