From 9a6f2864417d17de1a95c725aaa315b0bec15f40 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 1 Oct 2020 22:24:28 -0400 Subject: [PATCH] tests: Always run the import unsupported file type test --- tests/backend/specs/api/importexportGetPost.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/backend/specs/api/importexportGetPost.js b/tests/backend/specs/api/importexportGetPost.js index 065f6150a..95995cbcb 100644 --- a/tests/backend/specs/api/importexportGetPost.js +++ b/tests/backend/specs/api/importexportGetPost.js @@ -75,6 +75,18 @@ describe('Imports and Exports', function(){ } }); + const backups = {}; + + beforeEach(async function() { + // Note: This is a shallow copy. + backups.settings = Object.assign({}, settings); + }); + + afterEach(async function() { + // Note: This does not unset settings that were added. + Object.assign(settings, backups.settings); + }); + it('creates a new Pad, imports content to it, checks that content', async function() { await agent.get(endPoint('createPad') + `&padID=${testPadId}`) .expect(200) @@ -210,10 +222,7 @@ describe('Imports and Exports', function(){ }); it('Tries to import unsupported file type', async function() { - if (settings.allowUnknownFileEnds === true) { - console.log('skipping test because allowUnknownFileEnds is true'); - return this.skip(); - } + settings.allowUnknownFileEnds = false; await agent.post(`/p/${testPadId}/import`) .attach('file', padText, {filename: '/test.xasdasdxx', contentType: 'weirdness/jobby'}) .expect(200)