diff --git a/package.json b/package.json index 26e4269e6..8f1f836d7 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "@salesforce/command": "^5.2.1", "@salesforce/core": "^3.26.2", "@salesforce/kit": "^1.6.0", - "@salesforce/source-deploy-retrieve": "^6.8.1", - "@salesforce/source-tracking": "^2.2.3", + "@salesforce/source-deploy-retrieve": "^6.8.5", + "@salesforce/source-tracking": "^2.2.8", "chalk": "^4.1.2", "got": "^11.8.3", "jsforce": "^2.0.0-beta.16", @@ -188,4 +188,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/test/nuts/translation.nut.ts b/test/nuts/translation.nut.ts index db9df9818..f1320d035 100644 --- a/test/nuts/translation.nut.ts +++ b/test/nuts/translation.nut.ts @@ -8,8 +8,10 @@ import * as fs from 'fs'; import * as path from 'path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; import { expect } from 'chai'; +import { PushResponse } from 'src/formatters/source/pushResultFormatter'; import { DeployCommandResult } from '../../src/formatters/deployResultFormatter'; import { RetrieveCommandResult } from '../../src/formatters/retrieveResultFormatter'; +import { StatusResult } from '../../src/formatters/source/statusFormatter'; describe('translations', () => { let session: TestSession; @@ -32,6 +34,38 @@ describe('translations', () => { after(async () => { await session?.clean(); }); + describe('tracking/push', () => { + it('can deploy the whole project', async () => { + execCmd('force:source:push --json', { + ensureExitCode: 0, + }); + }); + + it('modify and see local change', async () => { + const fieldFile = path.join(translationPath, 'customField__c.fieldTranslation-meta.xml'); + const original = await fs.promises.readFile(fieldFile, 'utf8'); + await fs.promises.writeFile(fieldFile, original.replace('spanish', 'espaƱol')); + const statusResult = execCmd('force:source:status --json', { + ensureExitCode: 0, + }).jsonOutput.result; + + expect(statusResult[0].type).to.equal('CustomObjectTranslation'); + }); + + it('push local change', async () => { + const pushResult = execCmd('force:source:push --json', { + ensureExitCode: 0, + }).jsonOutput.result; + expect(pushResult.pushedSource.every((s) => s.type === 'CustomObjectTranslation')).to.be.true; + }); + + it('sees no local changes', () => { + const statusResult = execCmd('force:source:status --json', { + ensureExitCode: 0, + }).jsonOutput.result; + expect(statusResult).to.deep.equal([]); + }); + }); describe('manifest', () => { after(async () => { @@ -47,7 +81,7 @@ describe('translations', () => { const deployResults = execCmd('force:source:deploy -x package.xml --json', { ensureExitCode: 0, }).jsonOutput.result; - expect(deployResults.deployedSource.length).to.equal(6); + expect(deployResults.deployedSource.length).to.equal(7); }); it('retrieve without local metadata', async () => { @@ -94,14 +128,14 @@ describe('translations', () => { }); }); - it('can "deploy" CFTs', async () => { - // should not actually deploy anything - execCmd( + it('can deploy CFTs', async () => { + const result = execCmd( `force:source:deploy -p ${path.join(translationPath, 'customField__c.fieldTranslation-meta.xml')} --json`, { ensureExitCode: 0, } ); + expect(result.jsonOutput.result.deployedSource.some((d) => d.type === 'CustomObjectTranslation')).to.be.true; }); it('can deploy COT', async () => { diff --git a/yarn.lock b/yarn.lock index 600f6b389..0a9de9655 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1081,10 +1081,10 @@ "@salesforce/ts-types" "^1.5.21" chalk "^2.4.2" -"@salesforce/core@^3.19.5", "@salesforce/core@^3.23.3", "@salesforce/core@^3.23.9", "@salesforce/core@^3.24.0", "@salesforce/core@^3.25.0", "@salesforce/core@^3.25.1", "@salesforce/core@^3.26.2", "@salesforce/core@^3.26.3", "@salesforce/core@^3.30.0", "@salesforce/core@^3.30.2": - version "3.30.3" - resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-3.30.3.tgz#068c85cd1c6e11e88e4e737dcb828e312006ca0d" - integrity sha512-djB9N5knl/Hkl/JUwvMw8r5MhFrr+Koaxevxd1nR4WN3kyRiKYXZqFrMtekWONNfD3B/5eXndNG3gpgxhXyF8A== +"@salesforce/core@^3.19.5", "@salesforce/core@^3.23.3", "@salesforce/core@^3.23.9", "@salesforce/core@^3.24.0", "@salesforce/core@^3.25.0", "@salesforce/core@^3.25.1", "@salesforce/core@^3.26.2", "@salesforce/core@^3.30.0", "@salesforce/core@^3.30.10", "@salesforce/core@^3.30.2", "@salesforce/core@^3.30.9": + version "3.30.10" + resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-3.30.10.tgz#146724f2bbc294afbcb3fa41eac281d5d880f2f7" + integrity sha512-mVt/gLuF/zimBEs1oDThHm6GjKCRYkc6MuLjfwZrAo3m2H2QFH828HZEVU0nulkC4lF7F0kMXuLqk8n6sWwScw== dependencies: "@salesforce/bunyan" "^2.0.0" "@salesforce/kit" "^1.5.41" @@ -1149,12 +1149,12 @@ typedoc-plugin-missing-exports "0.23.0" typescript "^4.1.3" -"@salesforce/kit@^1.5.38", "@salesforce/kit@^1.5.41", "@salesforce/kit@^1.5.42", "@salesforce/kit@^1.5.44", "@salesforce/kit@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.6.0.tgz#0305dea2c9847d4b08068c4a9d436da5c9a5ce5e" - integrity sha512-8VZvWYl61jBaUIqo+pNoDvVqaZKPmqauvkhJHvcr/+D7+EXsjne9PDMggy5mNQJvonD6iegR/h3BqcWrppSaeQ== +"@salesforce/kit@^1.5.38", "@salesforce/kit@^1.5.41", "@salesforce/kit@^1.5.42", "@salesforce/kit@^1.5.44", "@salesforce/kit@^1.6.0", "@salesforce/kit@^1.6.1": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.7.0.tgz#f14ef71662742edf0fb74ffb23c530fad5ccb4c9" + integrity sha512-AxJi7W9skYEVQrZMGyWtG3xOOLzdRu7638Hlea3gtPdMpMRc0aB1Nvpg7Ru+VLtULNhXnnQ3nXesDl0d2TA04w== dependencies: - "@salesforce/ts-types" "^1.5.20" + "@salesforce/ts-types" "^1.5.21" shx "^0.3.3" tslib "^2.2.0" @@ -1227,13 +1227,13 @@ chalk "^4" inquirer "^8.2.0" -"@salesforce/source-deploy-retrieve@^6.8.0", "@salesforce/source-deploy-retrieve@^6.8.1": - version "6.8.1" - resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-6.8.1.tgz#ba0084af91275a17199df688e28899d801f2c7c2" - integrity sha512-lonMQj91Ojp7wMXxZ2xG7R2mNHO7vFnak9ypjxSqNx98usq+yWuiG83lp1eHdmuVRfPHAyEc3mGuOkYm7/O0Ug== +"@salesforce/source-deploy-retrieve@^6.8.0", "@salesforce/source-deploy-retrieve@^6.8.2", "@salesforce/source-deploy-retrieve@^6.8.5": + version "6.8.5" + resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-6.8.5.tgz#c8f91b25098019b5150082f7899ffe67d0c5916d" + integrity sha512-WxsE+UgVNhFhu2GBQh8bJlp/96XQ6fU58FtzRQvAWdumP1OzgzO2aenIa2acckw72e82+R0ftqJSbw1QAV/xrA== dependencies: - "@salesforce/core" "^3.26.3" - "@salesforce/kit" "^1.6.0" + "@salesforce/core" "^3.30.10" + "@salesforce/kit" "^1.6.1" "@salesforce/ts-types" "^1.5.20" "@xmldom/xmldom" "^0.8.2" archiver "^5.3.1" @@ -1263,14 +1263,14 @@ sinon "^10.0.0" strip-ansi "^7.0.1" -"@salesforce/source-tracking@^2.2.3": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-2.2.3.tgz#53d5c1df68e3ce2997f0458a520d8b27447bc414" - integrity sha512-a9ywSW5jllJ8iynLzBQI1dmYbDcy2CEH1CaiBgceAoN3jEakIrhTaozlmdEGncKtkpaIqFS+eosiCVM1dUUfvw== +"@salesforce/source-tracking@^2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@salesforce/source-tracking/-/source-tracking-2.2.8.tgz#f47401d48374a35e9a89a7468ee267d212d73668" + integrity sha512-qeDwZuUXlMh6If7j3MUPAdxtL5vVhhKptGLHP6z5QnU2SugHxr1THmMqVC3S1mYOIYYUoTFqsU2irnA7/BdG+A== dependencies: - "@salesforce/core" "^3.26.2" - "@salesforce/kit" "^1.6.0" - "@salesforce/source-deploy-retrieve" "^6.8.0" + "@salesforce/core" "^3.30.9" + "@salesforce/kit" "^1.6.1" + "@salesforce/source-deploy-retrieve" "^6.8.2" graceful-fs "^4.2.9" isomorphic-git "1.17.0" ts-retry-promise "^0.7.0"