From f96803a80698fb02002396b1895b891a89ef10ac Mon Sep 17 00:00:00 2001 From: heff Date: Tue, 17 Feb 2015 13:09:19 -0800 Subject: [PATCH] Fixed a poster test for IE11 --- test/unit/poster.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/unit/poster.js b/test/unit/poster.js index 348ea76bb..d5ab1454f 100644 --- a/test/unit/poster.js +++ b/test/unit/poster.js @@ -28,14 +28,19 @@ module('PosterImage', { test('should create and update a poster image', function(){ var posterImage; + // IE11 adds quotes in the returned background url so need to normalize the result + function normalizeUrl(url){ + return url.replace(new RegExp('\\"', 'g'),''); + } + vjs.BACKGROUND_SIZE_SUPPORTED = true; posterImage = new vjs.PosterImage(this.mockPlayer); - equal(posterImage.el().style.backgroundImage, 'url('+this.poster1+')', 'Background image used'); + equal(normalizeUrl(posterImage.el().style.backgroundImage), 'url('+this.poster1+')', 'Background image used'); // Update with a new poster source and check the new value this.mockPlayer.poster_ = this.poster2; this.mockPlayer.trigger('posterchange'); - equal(posterImage.el().style.backgroundImage, 'url('+this.poster2+')', 'Background image updated'); + equal(normalizeUrl(posterImage.el().style.backgroundImage), 'url('+this.poster2+')', 'Background image updated'); }); test('should create and update a fallback image in older browsers', function(){