From 0ffe9b9289cc5cddc0e6c4414518285c5ab31bcf Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Fri, 19 Jan 2018 17:28:47 +0100 Subject: [PATCH] Remove useless test from network_utils_spec.js Remove "returns null when content disposition is form-data". The name of the test is already misleading: It suggests that the return value is null if the Content-Disposition starts with "form-data". This is not the case, anything with the "filename" parameter is accepted. So, to correct this, one would have to rephrase the test description to "returns null when content disposition has no filename". But this is already tested by the test called "gets the filename from the response header". So, remove the test. --- test/unit/network_utils_spec.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/unit/network_utils_spec.js b/test/unit/network_utils_spec.js index b98ac5d01..d4fa96e8b 100644 --- a/test/unit/network_utils_spec.js +++ b/test/unit/network_utils_spec.js @@ -175,26 +175,6 @@ describe('network_utils', function() { })).toEqual('filename.pdf'); }); - it('returns null when content disposition is form-data', function() { - expect(extractFilenameFromHeader((headerName) => { - if (headerName === 'Content-Disposition') { - return 'form-data'; - } - })).toBeNull(); - - expect(extractFilenameFromHeader((headerName) => { - if (headerName === 'Content-Disposition') { - return 'form-data; name="filename.pdf"'; - } - })).toBeNull(); - - expect(extractFilenameFromHeader((headerName) => { - if (headerName === 'Content-Disposition') { - return 'form-data; name="filename.pdf"; filename="file.pdf"'; - } - })).toEqual('file.pdf'); - }); - it('only extracts filename with pdf extension', function () { expect(extractFilenameFromHeader((headerName) => { if (headerName === 'Content-Disposition') {