From 0ab345a4901dbeb324f2d75020158dba83cf697f Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 7 Sep 2015 10:00:06 -0700 Subject: [PATCH] Fix tests for Firefox --- src/components/Image/index.js | 2 +- src/components/Image/index.spec.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Image/index.js b/src/components/Image/index.js index 7329a9bd..6bb4222f 100644 --- a/src/components/Image/index.js +++ b/src/components/Image/index.js @@ -177,7 +177,7 @@ class Image extends React.Component { const defaultImage = defaultSource.uri || null const displayImage = !isLoaded ? defaultImage : source.uri const resolvedStyle = pickProps(style, Object.keys(ImageStylePropTypes)) - const backgroundImage = displayImage ? `url(${displayImage})` : null + const backgroundImage = displayImage ? `url("${displayImage}")` : null /** * Image is a non-stretching View. The image is displayed as a background diff --git a/src/components/Image/index.spec.js b/src/components/Image/index.spec.js index 52dcde0b..b4d5e29f 100644 --- a/src/components/Image/index.spec.js +++ b/src/components/Image/index.spec.js @@ -41,11 +41,14 @@ suite('Image', () => { test('prop "defaultSource"', () => { const defaultSource = { uri: 'https://google.com/favicon.ico' } const elementHasdefaultSource = getImageDOM({ defaultSource }) + const backgroundImage = elementHasdefaultSource.style.backgroundImage - assert.equal(elementHasdefaultSource.style.backgroundImage, `url(${defaultSource.uri})`) + assert(backgroundImage.indexOf(defaultSource.uri) > -1) }) - test('prop "onError"', (done) => { + test('prop "onError"', function(done) { + this.timeout(5000); + function onError(e) { assert.equal(e.nativeEvent.type, 'error') done() @@ -57,7 +60,9 @@ suite('Image', () => { />) }) - test('prop "onLoad"', (done) => { + test('prop "onLoad"', function(done) { + this.timeout(5000); + function onLoad(e) { assert.equal(e.nativeEvent.type, 'load') done()