-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wr/coft NUTs #783
Wr/coft NUTs #783
Changes from all commits
b9baf64
e8a8725
581d29d
834b1cb
849d4bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', { | ||
|
@@ -161,24 +162,76 @@ describe('translations', () => { | |
}); | ||
|
||
describe('individual type retrieves', () => { | ||
it('can retrieve COT', async () => { | ||
it('can retrieve COT from CFT', async () => { | ||
execCmd(`project retrieve start -d ${translationPath} --json`, { | ||
ensureExitCode: 0, | ||
}); | ||
}); | ||
|
||
it('can retrieve COT from directory', async () => { | ||
execCmd( | ||
`project retrieve start -d ${path.join( | ||
translationPath, | ||
'customObject__c-es.objectTranslation-meta.xml' | ||
)} --json`, | ||
{ | ||
ensureExitCode: 0, | ||
} | ||
// the .objectTranslation is in my-app | ||
const objectTranslationPath = path.join( | ||
session.project.dir, | ||
'my-app', | ||
'main', | ||
'default', | ||
'objectTranslations', | ||
'customObject__c-es', | ||
'customObject__c-es.objectTranslation-meta.xml' | ||
); | ||
|
||
execCmd(`project retrieve start -d ${objectTranslationPath} --json`, { | ||
ensureExitCode: 0, | ||
}); | ||
}); | ||
}); | ||
|
||
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't really retrieving across package dirs. It's retrieving a COT to the default location. I think we need a test that has COT and COFT and ensure it can be retrieved to the default package and to a specific non-default package. E.g., having a COT in my-app, deploying a COFT for that COT from outside of the project, then retrieving it. |
||
|
||
// 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), | ||
]); | ||
}); | ||
}); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is retrieving a COT by filename, not directory. Also, I think we can't rely on just the exit code 0 as a success. I think we need to ensure the retrieve was written to the correct place and not the default location.