diff --git a/package.json b/package.json index 8bee0bc7..07198a44 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@oclif/plugin-command-snapshot": "^5.1.6", - "@salesforce/cli-plugins-testkit": "^5.2.0", + "@salesforce/cli-plugins-testkit": "^5.3.0", "@salesforce/dev-scripts": "^9.0.0", "@salesforce/plugin-command-reference": "^3.0.82", "@salesforce/source-testkit": "^2.2.5", diff --git a/test/nuts/delete/source.nut.ts b/test/nuts/delete/source.nut.ts index 779d32b0..e2f3b809 100644 --- a/test/nuts/delete/source.nut.ts +++ b/test/nuts/delete/source.nut.ts @@ -7,15 +7,18 @@ import * as fs from 'node:fs'; import { fileURLToPath } from 'node:url'; +import { platform } from 'node:os'; import * as path from 'node:path'; -import { expect, assert } from 'chai'; -import { execCmd } from '@salesforce/cli-plugins-testkit'; +import { expect, assert, config } from 'chai'; +import { Interaction, execCmd, execInteractiveCmd } from '@salesforce/cli-plugins-testkit'; import { SourceTestkit } from '@salesforce/source-testkit'; import { FileResponse } from '@salesforce/source-deploy-retrieve'; import { AuthInfo, Connection } from '@salesforce/core'; import { ensureArray } from '@salesforce/ts-types'; import { DeleteSourceJson } from '../../../src/utils/types.js'; +config.truncateThreshold = 0; + const isNameObsolete = async (username: string, memberType: string, memberName: string): Promise => { const connection = await Connection.create({ authInfo: await AuthInfo.create({ username }), @@ -265,4 +268,21 @@ describe('project delete source NUTs', () => { expect(await isNameObsolete(testkit.username, 'LightningComponentBundle', 'brokerCard')).to.be.false; expect(fs.existsSync(brokerPath)).to.be.true; }); + + (platform() === 'win32' ? it.skip : it)('deletes a remote-only layout using interactive prompt', async () => { + const layoutName = 'Account-Account %28Marketing%29 Layout'; + const response = ( + await execInteractiveCmd( + ['project:delete:source', '--metadata', `Layout:${layoutName}`], + { + 'Are you sure': Interaction.Yes, + }, + { + ensureExitCode: 0, + } + ) + ).stdout; + expect(response).to.include('Deleted Source'); + expect(response).to.include(layoutName); + }); }); diff --git a/yarn.lock b/yarn.lock index 72f4d8be..69fd7ba1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1687,7 +1687,7 @@ istanbul-lib-report "^3.0.1" istanbul-reports "^3.1.6" -"@salesforce/cli-plugins-testkit@^5.2.0", "@salesforce/cli-plugins-testkit@^5.2.1": +"@salesforce/cli-plugins-testkit@^5.2.1", "@salesforce/cli-plugins-testkit@^5.3.0": version "5.3.0" resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-5.3.0.tgz#ec7c8da49c36e4c07f6ddc80cb57776e687e4925" integrity sha512-g+kmsucxS8QBxlV9gjltl4lVW8GjvtlQNUijhtZEqm9Vwb0s5MG/K0wfzg2MwVUZ+ZwNWgcKnRruD5K8LzMZkA== @@ -7454,16 +7454,7 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7522,14 +7513,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8067,7 +8051,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8085,15 +8069,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"