Skip to content

Commit

Permalink
test: add new mpd NUT
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Oct 19, 2023
1 parent 581d29d commit 834b1cb
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/nuts/specialTypes/translation.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('translations', () => {
after(async () => {
await session?.clean();
});

describe('tracking/push', () => {
it('can deploy the whole project', async () => {
execCmd('project deploy start --json', {
Expand Down Expand Up @@ -184,6 +185,53 @@ describe('translations', () => {
});
});
});

it('will retrieve across MPDs', async () => {
// read the file before deleting it to restore it after this test
const objectTranslationMyAppPath = path.join(
session.project.dir,
'my-app',
'main',
'default',
'objectTranslations',
'customObject__c-es',
'customObject__c-es.objectTranslation-meta.xml'
);
const objectTranslationContent = await fs.promises.readFile(objectTranslationMyAppPath, 'utf8');

// delete the file
await fs.promises.unlink(objectTranslationMyAppPath);
execCmd('project retrieve start -m CustomObjectTranslation --json', { ensureExitCode: 0 });
expect(
fs.existsSync(
path.join(
session.project.dir,
'force-app',
'main',
'default',
'objectTranslations',
'customObject__c-es',
'customObject__c-es.objectTranslation-meta.xml'
)
)
).to.be.true;

// if the assertions passed, let's delete the new file, and recreate the old
await Promise.all([
fs.promises.unlink(
path.join(
session.project.dir,
'force-app',
'main',
'default',
'objectTranslations',
'customObject__c-es',
'customObject__c-es.objectTranslation-meta.xml'
)
),
fs.promises.writeFile(objectTranslationMyAppPath, objectTranslationContent),
]);
});
});
});

Expand Down

0 comments on commit 834b1cb

Please sign in to comment.