Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions test/commands/package/install.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { Duration } from '@salesforce/kit';
type PackageInstallRequest = PackagingSObjects.PackageInstallRequest;
type PackageUninstallRequest = PackagingSObjects.SubscriberPackageVersionUninstallRequest;

const DREAMHOUSE = { id: '04tKY000000MF7uYAG', name: 'DreamHouseLWC' };

describe('package install', () => {
let session: TestSession;
before(async () => {
Expand All @@ -42,15 +44,15 @@ describe('package install', () => {
await session?.clean();
});

it('should install ElectronBranding package with polling', () => {
const command = 'package:install -p 04t6A000002zgKSQAY -w 20';
it('should install DreamHouseLWC package with polling', () => {
const command = `package:install -p ${DREAMHOUSE.id} -w 20`;
const output = execCmd(command, { ensureExitCode: 0, timeout: Duration.minutes(20).milliseconds }).shellOutput
.stdout;
expect(output).to.contain('Successfully installed package');
});

it('should install DFXP Escape Room package (async) and report', () => {
const installCommand = 'package:install -p 04t6A000002zgKSQAY --json';
it('should install DreamHouseLWC package (async) and report', () => {
const installCommand = `package:install -p ${DREAMHOUSE.id} --json`;
const installJson = execCmd<PackageInstallRequest>(installCommand, { ensureExitCode: 0 }).jsonOutput?.result;
expect(installJson).to.have.property('Status', 'IN_PROGRESS');

Expand All @@ -61,7 +63,7 @@ describe('package install', () => {
});

it('should start an uninstall request, and report on it', () => {
const uninstallCommand = 'package:uninstall -p 04t6A000002zgKSQAY --json -w 0';
const uninstallCommand = `package:uninstall -p ${DREAMHOUSE.id} --json -w 0`;
const uninstallRequest = execCmd<PackageUninstallRequest>(uninstallCommand, {
ensureExitCode: 0,
}).jsonOutput?.result;
Expand Down
4 changes: 2 additions & 2 deletions test/commands/package/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { SfCommand, stubPrompter } from '@salesforce/sf-plugins-core';
import { Install } from '../../../src/commands/package/install.js';
import InstallValidationStatus = PackagingSObjects.InstallValidationStatus;

const myPackageVersion04t = '04t6A000002zgKSQAY';
const myPackageVersion04t = '04tKY000000MF7uYAG';

const pkgInstallRequest = {
attributes: {
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('package:install', () => {
const result = await cmd.run();

expect(uxLogStub.calledOnce).to.be.true;
const msg = 'Successfully installed package [04t6A000002zgKSQAY]';
const msg = 'Successfully installed package [04tKY000000MF7uYAG]';
expect(uxLogStub.args[0][0]).to.equal(msg);
expect(result).to.deep.equal(request);
expect(installStub.args[0][0]).to.deep.equal(pkgInstallCreateRequest);
Expand Down
4 changes: 2 additions & 2 deletions test/commands/package/installReport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const pkgInstallRequest = {
LastModifiedDate: '2022-08-09T05:13:14.000+0000',
LastModifiedById: '0051h000009NugzAAC',
SystemModstamp: '2022-08-09T05:13:14.000+0000',
SubscriberPackageVersionKey: '04t6A000002zgKSQAY',
SubscriberPackageVersionKey: '04tKY000000MF7uYAG',
NameConflictResolution: 'Block',
SecurityType: 'None',
PackageInstallSource: 'U',
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('package:install:report', () => {
const result = await new Report(['-i', pkgInstallRequest.Id, '--target-org', testOrg.username], config).run();
expect(result).to.deep.equal(request);
expect(uxLogStub.calledOnce).to.be.true;
expect(uxLogStub.args[0][0]).to.equal('Successfully installed package [04t6A000002zgKSQAY]');
expect(uxLogStub.args[0][0]).to.equal('Successfully installed package [04tKY000000MF7uYAG]');
});

it('should report IN_PROGRESS status', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/commands/package/version.delete.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('package:version:delete', () => {
} as PackageSaveResult);
uxConfirmStub.resolves(true);

const command = new PackageVersionDeleteCommand(['-p', '04t6A000002zgKSQAY', '-v', 'foor@bar.org'], config);
const command = new PackageVersionDeleteCommand(['-p', '04tKY000000MF7uYAG', '-v', 'foor@bar.org'], config);
command.project = SfProject.getInstance();
const results: PackageSaveResult = await command.run();
expect(results.id).to.equal('testId');
Expand All @@ -112,7 +112,7 @@ describe('package:version:delete', () => {
} as PackageSaveResult);
uxConfirmStub.resolves(true);
const command = new PackageVersionDeleteCommand(
['-p', '04t6A000002zgKSQAY', '-v', 'foor@bar.org', '--undelete'],
['-p', '04tKY000000MF7uYAG', '-v', 'foor@bar.org', '--undelete'],
config
);
command.project = SfProject.getInstance();
Expand Down
Loading