From 5cc01476e4c9b0803bcac0bcb065eae4b086b025 Mon Sep 17 00:00:00 2001 From: Hendrik Leppelsack Date: Wed, 29 Jun 2016 15:14:34 +0200 Subject: [PATCH] adjusts tests to removal of svg fallback --- core/js/tests/specs/coreSpec.js | 39 +-------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js index 3d19a38c41..1ffe7b38a4 100644 --- a/core/js/tests/specs/coreSpec.js +++ b/core/js/tests/specs/coreSpec.js @@ -231,22 +231,12 @@ describe('Core base tests', function() { }); describe('Images', function() { it('Generates image path with given extension', function() { - var svgSupportStub = sinon.stub(OC.Util, 'hasSVGSupport', function() { return true; }); expect(OC.imagePath('core', 'somefile.jpg')).toEqual(OC.webroot + '/core/img/somefile.jpg'); expect(OC.imagePath(TESTAPP, 'somefile.jpg')).toEqual(TESTAPP_ROOT + '/img/somefile.jpg'); - svgSupportStub.restore(); }); - it('Generates image path with svg extension when svg support exists', function() { - var svgSupportStub = sinon.stub(OC.Util, 'hasSVGSupport', function() { return true; }); + it('Generates image path with svg extension', function() { expect(OC.imagePath('core', 'somefile')).toEqual(OC.webroot + '/core/img/somefile.svg'); expect(OC.imagePath(TESTAPP, 'somefile')).toEqual(TESTAPP_ROOT + '/img/somefile.svg'); - svgSupportStub.restore(); - }); - it('Generates image path with png ext when svg support is not available', function() { - var svgSupportStub = sinon.stub(OC.Util, 'hasSVGSupport', function() { return false; }); - expect(OC.imagePath('core', 'somefile')).toEqual(OC.webroot + '/core/img/somefile.png'); - expect(OC.imagePath(TESTAPP, 'somefile')).toEqual(TESTAPP_ROOT + '/img/somefile.png'); - svgSupportStub.restore(); }); }); }); @@ -504,32 +494,6 @@ describe('Core base tests', function() { expect($navigation.is(':visible')).toEqual(false); }); }); - describe('SVG extension replacement', function() { - var svgSupportStub; - - beforeEach(function() { - svgSupportStub = sinon.stub(OC.Util, 'hasSVGSupport'); - }); - afterEach(function() { - svgSupportStub.restore(); - }); - it('does not replace svg extension with png when SVG is supported', function() { - svgSupportStub.returns(true); - expect( - OC.Util.replaceSVGIcon('/path/to/myicon.svg?someargs=1') - ).toEqual( - '/path/to/myicon.svg?someargs=1' - ); - }); - it('replaces svg extension with png when SVG not supported', function() { - svgSupportStub.returns(false); - expect( - OC.Util.replaceSVGIcon('/path/to/myicon.svg?someargs=1') - ).toEqual( - '/path/to/myicon.png?someargs=1' - ); - }); - }); describe('Util', function() { describe('humanFileSize', function() { it('renders file sizes with the correct unit', function() { @@ -1017,4 +981,3 @@ describe('Core base tests', function() { }); }); }); -