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.
This commit is contained in:
Rob Wu 2018-01-19 17:28:47 +01:00
parent 75dc2bbd35
commit 0ffe9b9289

View File

@ -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') {