Skip to content

Commit

Permalink
fix upload-custom-translations > medic-2.x and `upload-custom-trans…
Browse files Browse the repository at this point in the history
…lations > 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`
  • Loading branch information
m5r committed Nov 27, 2023
1 parent d494f50 commit 37ce951
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions test/fn/upload-custom-translations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const log = require('../../src/lib/log');
const uploadCustomTranslations = require('../../src/fn/upload-custom-translations').execute;
const { getTranslationDoc, expectTranslationDocs } = require('./utils');

describe('upload-custom-translations', function () {
this.timeout(45000);

describe('upload-custom-translations', () => {
const testProjectDir = './data/upload-custom-translations/';
let mockTestDir;

Expand All @@ -27,7 +25,9 @@ describe('upload-custom-translations', function () {
await api.stop();
});

describe('medic-2.x', () => {
describe('medic-2.x', function () {
this.timeout(60000);

beforeEach(() => {
// medic-client does not have deploy_info property
return api.db.put({ _id: '_design/medic-client' });
Expand All @@ -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`);
Expand All @@ -68,10 +64,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`);
Expand Down Expand Up @@ -178,21 +170,10 @@ 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' },
},
);*/
describe('3.0.0', function () {
this.timeout(60000);

beforeEach(() => {
readline.keyInYN = () => true;
readline.keyInSelect = () => 0;
return api.db.put({ _id: '_design/medic-client', deploy_info: { version: '3.0.0' } });
Expand Down Expand Up @@ -318,7 +299,9 @@ describe('upload-custom-translations', function () {
});
});

describe('3.4.0', () => {
describe('3.4.0', function () {
this.timeout(60000);

beforeEach(() => {
api.db.put({ _id: '_design/medic-client', deploy_info: { version: '3.4.0' } });
});
Expand Down

0 comments on commit 37ce951

Please sign in to comment.