Skip to content

Commit

Permalink
fix `upload-custom-translations > medic-3.x > 3.5.0 > should upload t…
Browse files Browse the repository at this point in the history
…ranslations for multiple languages` 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 4df5266 commit d494f50
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions test/fn/upload-custom-translations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,12 @@ describe('upload-custom-translations', function () {

describe('3.5.0', () => {
beforeEach(() => {
// api/deploy-info endpoint exists
api.giveResponses({ status: 200, body: { version: '3.5.0' } });
return api.db.put({ _id: '_design/medic-client', deploy_info: { version: '3.5.0' } });
});

it('should upload simple translations', () => {
// api/deploy-info endpoint exists
api.giveResponses(
{ status: 200, body: { version: '3.5.0' } },
);

mockTestDir(`simple`);
return uploadCustomTranslations()
.then(() => expectTranslationDocs(api, 'en'))
Expand All @@ -514,15 +511,6 @@ describe('upload-custom-translations', function () {
});

it('should upload translations for multiple languages', () => {
// api/deploy-info endpoint exists
api.giveResponses(
{ status: 200, body: { version: '3.5.0' } },
{
status: 200,
body: { compressible_types: 'text/*, application/javascript, application/json, application/xml' },
},
);

mockTestDir(`multi-lang`);
return uploadCustomTranslations()
.then(() => expectTranslationDocs(api, 'en', 'fr'))
Expand All @@ -543,9 +531,6 @@ describe('upload-custom-translations', function () {
});

it('should upload translations containing equals signs', () => {
// api/deploy-info endpoint exists
api.giveResponses({ status: 200, body: { version: '3.5.0' } });

mockTestDir(`contains-equals`);
return uploadCustomTranslations()
.then(() => expectTranslationDocs(api, 'en'))
Expand All @@ -561,9 +546,6 @@ describe('upload-custom-translations', function () {
});

it('should set default name for unknown language', () => {
// api/deploy-info endpoint exists
api.giveResponses({ status: 200, body: { version: '3.5.0' } });

mockTestDir(`unknown-lang`);
return uploadCustomTranslations()
.then(() => expectTranslationDocs(api, 'qp'))
Expand All @@ -574,9 +556,6 @@ describe('upload-custom-translations', function () {
});

it('should properly upload translations containing escaped exclamation marks', () => {
// api/deploy-info endpoint exists
api.giveResponses({ status: 200, body: { version: '3.5.0' } });

mockTestDir(`escaped-exclamation`);
return uploadCustomTranslations()
.then(() => expectTranslationDocs(api, 'en'))
Expand All @@ -592,9 +571,6 @@ describe('upload-custom-translations', function () {
});

it('upload translations containing empty messages raises warn logs but works', () => {
// api/deploy-info endpoint exists
api.giveResponses({ status: 200, body: { version: '3.5.0' } });

mockTestDir('contains-empty-messages');
sinon.replace(log, 'warn', sinon.fake());
return uploadCustomTranslations()
Expand Down

0 comments on commit d494f50

Please sign in to comment.