From fece1a5eb98c7cb15f10f4421b6c2090fcd7fd70 Mon Sep 17 00:00:00 2001 From: m5r Date: Mon, 27 Nov 2023 23:32:33 +0100 Subject: [PATCH] fix `upload-custom-translations > medic-2.x` and `upload-custom-translations > medic-3.x > 3.0.0` conflicting with `request` mock in `warn-upload-overwrite > prompts when attempting to overwrite docs > shows diff when local is different from remote and the user requests a diff` --- test/fn/upload-custom-translations.spec.js | 26 +++------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/test/fn/upload-custom-translations.spec.js b/test/fn/upload-custom-translations.spec.js index b395bafa8..e32a63598 100644 --- a/test/fn/upload-custom-translations.spec.js +++ b/test/fn/upload-custom-translations.spec.js @@ -8,7 +8,7 @@ const uploadCustomTranslations = require('../../src/fn/upload-custom-translation const { getTranslationDoc, expectTranslationDocs } = require('./utils'); describe('upload-custom-translations', function () { - this.timeout(45000); + this.timeout(30000); const testProjectDir = './data/upload-custom-translations/'; let mockTestDir; @@ -42,10 +42,6 @@ describe('upload-custom-translations', function () { { status: 404, body: { error: 'not_found' } }, { status: 404, body: { error: 'not_found' } }, { status: 404, body: { error: 'not_found' } }, - { - status: 200, - body: { compressible_types: 'text/*, application/javascript, application/json, application/xml' }, - }, ); mockTestDir(`simple`); @@ -59,7 +55,8 @@ describe('upload-custom-translations', function () { }); }); - it('should upload translations for multiple languages', () => { + it('should upload translations for multiple languages', function () { + this.timeout(60000); // this one takes longer because of the additional failed requests intentionally not mocked // api/deploy-info endpoint doesn't exist api.giveResponses( { status: 404, body: { error: 'not_found' } }, @@ -68,10 +65,6 @@ describe('upload-custom-translations', function () { { status: 404, body: { error: 'not_found' } }, { status: 404, body: { error: 'not_found' } }, { status: 404, body: { error: 'not_found' } }, - { - status: 200, - body: { compressible_types: 'text/*, application/javascript, application/json, application/xml' }, - }, ); mockTestDir(`multi-lang`); @@ -180,19 +173,6 @@ describe('upload-custom-translations', function () { describe('medic-3.x', () => { describe('3.0.0', () => { beforeEach(() => { - /*api.giveResponses( - { status: 404, body: { error: 'not_found' } }, - { status: 404, body: { error: 'not_found' } }, - { status: 404, body: { error: 'not_found' } }, - { status: 404, body: { error: 'not_found' } }, - { status: 404, body: { error: 'not_found' } }, - { status: 404, body: { error: 'not_found' } }, - { - status: 200, - body: { compressible_types: 'text/!*, application/javascript, application/json, application/xml' }, - }, - );*/ - readline.keyInYN = () => true; readline.keyInSelect = () => 0; return api.db.put({ _id: '_design/medic-client', deploy_info: { version: '3.0.0' } });