From 1dbd7e055dc10c105e6dfaa9cf56a65810f96c2f Mon Sep 17 00:00:00 2001
From: TJ Klug <37849456+TomJKlug@users.noreply.github.com>
Date: Thu, 26 Sep 2019 09:48:40 -0500
Subject: [PATCH] fix(Image): Allow passing testID (#2092)
Fixes #2091
---
src/image/Image.js | 2 +-
src/image/__tests__/Image.js | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/image/Image.js b/src/image/Image.js
index e71ac7d863..b9fe8d1fbc 100644
--- a/src/image/Image.js
+++ b/src/image/Image.js
@@ -50,6 +50,7 @@ class Image extends React.Component {
style={StyleSheet.flatten([styles.container, containerStyle])}
>
{
expect(toJson(component)).toMatchSnapshot();
});
+ it('should render the appropriate testId when one is passed.', () => {
+ const component = shallow(
+
+ );
+
+ 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(
+
+ );
+
+ const image = component.find({ testID: 'RNE__Image' });
+
+ expect(image.length).toBe(1);
+ });
+
it('should apply values from theme', () => {
const theme = {
Image: {