]> source.dussan.org Git - nextcloud-server.git/commitdiff
adjusts tests to removal of svg fallback
authorHendrik Leppelsack <hendrik@leppelsack.de>
Wed, 29 Jun 2016 13:14:34 +0000 (15:14 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 1 Jul 2016 14:36:37 +0000 (16:36 +0200)
core/js/tests/specs/coreSpec.js

index 3d19a38c4168b45bbbde0987caf86bd92259ff80..1ffe7b38a40bc04a747466e02e06dd634822f6fb 100644 (file)
@@ -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() {
                });
        });
 });
-