From 1a33c0c58b25a750745a5e39444f565b93f7ecd1 Mon Sep 17 00:00:00 2001 From: Dawson David Date: Thu, 15 Oct 2026 13:19:51 -0700 Subject: [PATCH 1/2] test: align SPI output expectations for W-24346804 @W-24346804: Match trust-link messages and expect DistributionType for API 68 and later --- test/commands/package/packageList.nut.ts | 3 +++ test/commands/package/packageTrustLinkApprove.test.ts | 4 +++- test/commands/package/packageTrustLinkDeny.test.ts | 4 +++- test/commands/package/packageTrustLinkRequest.test.ts | 5 +++-- test/commands/package/packageTrustLinkRevoke.test.ts | 4 +++- test/commands/package/packageTrustLinkStatus.test.ts | 9 ++++++--- test/commands/package/packageTrustLinkUnlink.test.ts | 5 +++-- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/test/commands/package/packageList.nut.ts b/test/commands/package/packageList.nut.ts index 95fea717..589c9486 100644 --- a/test/commands/package/packageList.nut.ts +++ b/test/commands/package/packageList.nut.ts @@ -57,6 +57,9 @@ describe('package list', () => { if (apiVersion < 59) { keys.splice(keys.indexOf('AppAnalyticsEnabled'), 1); } + if (apiVersion >= 68) { + keys.push('DistributionType'); + } const deprecatedPackages = packages.filter((pkg) => pkg.IsDeprecated); const notDeprecatedCount = packages.length - deprecatedPackages.length; expect(output).to.be.ok; diff --git a/test/commands/package/packageTrustLinkApprove.test.ts b/test/commands/package/packageTrustLinkApprove.test.ts index b8016482..412576f7 100644 --- a/test/commands/package/packageTrustLinkApprove.test.ts +++ b/test/commands/package/packageTrustLinkApprove.test.ts @@ -58,7 +58,9 @@ describe('package:trust:link:approve - tests', () => { expect(result).to.deep.equal(approveResult); expect(approveStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); + expect(sfCommandStubs.log.firstCall.args[0]).to.equal( + `Approved trust link request ${requestId} from the authoring org ${authoringOrgId}.` + ); }); it('approves a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkDeny.test.ts b/test/commands/package/packageTrustLinkDeny.test.ts index 426a991a..4c22d771 100644 --- a/test/commands/package/packageTrustLinkDeny.test.ts +++ b/test/commands/package/packageTrustLinkDeny.test.ts @@ -58,7 +58,9 @@ describe('package:trust:link:deny - tests', () => { expect(result).to.deep.equal(denyResult); expect(denyStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); + expect(sfCommandStubs.log.firstCall.args[0]).to.equal( + `Denied trust link request ${requestId} from authoring org ${authoringOrgId}.` + ); }); it('denies a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkRequest.test.ts b/test/commands/package/packageTrustLinkRequest.test.ts index 4b2e7ecf..5a9c48d5 100644 --- a/test/commands/package/packageTrustLinkRequest.test.ts +++ b/test/commands/package/packageTrustLinkRequest.test.ts @@ -79,8 +79,9 @@ describe('package:trust:link:request - tests', () => { expect(sfCommandStubs.log.calledOnce).to.be.true; const logged = sfCommandStubs.log.firstCall.args[0]; - expect(logged).to.contain(linkResult.VerifiedOrgId); - expect(logged).to.contain(linkResult.LinkRequestId); + expect(logged).to.equal( + `Requested a trust link to Verified PBO ${verifiedOrgId}. The request is pending approval by a Verified PBO admin. [Trust link ID: ${linkResult.LinkRequestId}]` + ); }); it('surfaces errors thrown by the library', async () => { diff --git a/test/commands/package/packageTrustLinkRevoke.test.ts b/test/commands/package/packageTrustLinkRevoke.test.ts index 6d57aff2..81c8581b 100644 --- a/test/commands/package/packageTrustLinkRevoke.test.ts +++ b/test/commands/package/packageTrustLinkRevoke.test.ts @@ -58,7 +58,9 @@ describe('package:trust:link:revoke - tests', () => { expect(result).to.deep.equal(revokeResult); expect(revokeStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); + expect(sfCommandStubs.log.firstCall.args[0]).to.equal( + `Revoked trust link ${requestId} from authoring org ${authoringOrgId}.` + ); }); it('revokes a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkStatus.test.ts b/test/commands/package/packageTrustLinkStatus.test.ts index 4d1a78b5..778b111d 100644 --- a/test/commands/package/packageTrustLinkStatus.test.ts +++ b/test/commands/package/packageTrustLinkStatus.test.ts @@ -61,8 +61,9 @@ describe('package:trust:link:status - tests', () => { // status line + requested + established timestamps expect(sfCommandStubs.log.callCount).to.equal(3); const statusLine = sfCommandStubs.log.firstCall.args[0]; - expect(statusLine).to.contain('Accepted'); - expect(statusLine).to.contain(verifiedOrgId); + expect(statusLine).to.equal(`Trust link status: Accepted (Verified PBO ${verifiedOrgId}).`); + expect(sfCommandStubs.log.secondCall.args[0]).to.equal(`Requested: ${linkedResult.RequestedDate}`); + expect(sfCommandStubs.log.thirdCall.args[0]).to.equal(`Approved: ${linkedResult.EstablishedDate}`); }); it('reports the Not Linked state when the org has no link', async () => { @@ -75,7 +76,9 @@ describe('package:trust:link:status - tests', () => { expect(result).to.deep.equal(notLinked); expect(sfCommandStubs.log.calledOnce).to.be.true; - expect(sfCommandStubs.log.firstCall.args[0]).to.contain('Not Linked'); + expect(sfCommandStubs.log.firstCall.args[0]).to.equal( + 'This org has no trust link request to a Verified PBO. Its status is Not Linked.' + ); }); it('logs only the timestamps that are set (Pending link, no established/revoked)', async () => { diff --git a/test/commands/package/packageTrustLinkUnlink.test.ts b/test/commands/package/packageTrustLinkUnlink.test.ts index 5a856fc6..b5565d44 100644 --- a/test/commands/package/packageTrustLinkUnlink.test.ts +++ b/test/commands/package/packageTrustLinkUnlink.test.ts @@ -58,8 +58,9 @@ describe('package:trust:link:unlink - tests', () => { expect(unlinkStub.calledOnce).to.be.true; expect(sfCommandStubs.log.calledOnce).to.be.true; const logged = sfCommandStubs.log.firstCall.args[0]; - expect(logged).to.contain(verifiedOrgId); - expect(logged).to.contain('Pending'); + expect(logged).to.equal( + `Removed the trust link to Verified PBO ${verifiedOrgId} (was Pending). This org is now Not Linked.` + ); }); it('reports the already Not Linked state when nothing was removed', async () => { From 54f4b1c79f89703f04257f31f16e1c68fee015c7 Mon Sep 17 00:00:00 2001 From: Dawson David Date: Thu, 15 Oct 2026 15:02:50 -0700 Subject: [PATCH 2/2] test: revert wording assertions for W-24346804 @W-24346804: Keep only the API 68 DistributionType expectation --- test/commands/package/packageTrustLinkApprove.test.ts | 4 +--- test/commands/package/packageTrustLinkDeny.test.ts | 4 +--- test/commands/package/packageTrustLinkRequest.test.ts | 5 ++--- test/commands/package/packageTrustLinkRevoke.test.ts | 4 +--- test/commands/package/packageTrustLinkStatus.test.ts | 9 +++------ test/commands/package/packageTrustLinkUnlink.test.ts | 5 ++--- 6 files changed, 10 insertions(+), 21 deletions(-) diff --git a/test/commands/package/packageTrustLinkApprove.test.ts b/test/commands/package/packageTrustLinkApprove.test.ts index 412576f7..b8016482 100644 --- a/test/commands/package/packageTrustLinkApprove.test.ts +++ b/test/commands/package/packageTrustLinkApprove.test.ts @@ -58,9 +58,7 @@ describe('package:trust:link:approve - tests', () => { expect(result).to.deep.equal(approveResult); expect(approveStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.equal( - `Approved trust link request ${requestId} from the authoring org ${authoringOrgId}.` - ); + expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); }); it('approves a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkDeny.test.ts b/test/commands/package/packageTrustLinkDeny.test.ts index 4c22d771..426a991a 100644 --- a/test/commands/package/packageTrustLinkDeny.test.ts +++ b/test/commands/package/packageTrustLinkDeny.test.ts @@ -58,9 +58,7 @@ describe('package:trust:link:deny - tests', () => { expect(result).to.deep.equal(denyResult); expect(denyStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.equal( - `Denied trust link request ${requestId} from authoring org ${authoringOrgId}.` - ); + expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); }); it('denies a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkRequest.test.ts b/test/commands/package/packageTrustLinkRequest.test.ts index 5a9c48d5..4b2e7ecf 100644 --- a/test/commands/package/packageTrustLinkRequest.test.ts +++ b/test/commands/package/packageTrustLinkRequest.test.ts @@ -79,9 +79,8 @@ describe('package:trust:link:request - tests', () => { expect(sfCommandStubs.log.calledOnce).to.be.true; const logged = sfCommandStubs.log.firstCall.args[0]; - expect(logged).to.equal( - `Requested a trust link to Verified PBO ${verifiedOrgId}. The request is pending approval by a Verified PBO admin. [Trust link ID: ${linkResult.LinkRequestId}]` - ); + expect(logged).to.contain(linkResult.VerifiedOrgId); + expect(logged).to.contain(linkResult.LinkRequestId); }); it('surfaces errors thrown by the library', async () => { diff --git a/test/commands/package/packageTrustLinkRevoke.test.ts b/test/commands/package/packageTrustLinkRevoke.test.ts index 81c8581b..6d57aff2 100644 --- a/test/commands/package/packageTrustLinkRevoke.test.ts +++ b/test/commands/package/packageTrustLinkRevoke.test.ts @@ -58,9 +58,7 @@ describe('package:trust:link:revoke - tests', () => { expect(result).to.deep.equal(revokeResult); expect(revokeStub.firstCall.args[1]).to.deep.equal({ requestId }); - expect(sfCommandStubs.log.firstCall.args[0]).to.equal( - `Revoked trust link ${requestId} from authoring org ${authoringOrgId}.` - ); + expect(sfCommandStubs.log.firstCall.args[0]).to.contain(requestId); }); it('revokes a trust link selected by authoring org', async () => { diff --git a/test/commands/package/packageTrustLinkStatus.test.ts b/test/commands/package/packageTrustLinkStatus.test.ts index 778b111d..4d1a78b5 100644 --- a/test/commands/package/packageTrustLinkStatus.test.ts +++ b/test/commands/package/packageTrustLinkStatus.test.ts @@ -61,9 +61,8 @@ describe('package:trust:link:status - tests', () => { // status line + requested + established timestamps expect(sfCommandStubs.log.callCount).to.equal(3); const statusLine = sfCommandStubs.log.firstCall.args[0]; - expect(statusLine).to.equal(`Trust link status: Accepted (Verified PBO ${verifiedOrgId}).`); - expect(sfCommandStubs.log.secondCall.args[0]).to.equal(`Requested: ${linkedResult.RequestedDate}`); - expect(sfCommandStubs.log.thirdCall.args[0]).to.equal(`Approved: ${linkedResult.EstablishedDate}`); + expect(statusLine).to.contain('Accepted'); + expect(statusLine).to.contain(verifiedOrgId); }); it('reports the Not Linked state when the org has no link', async () => { @@ -76,9 +75,7 @@ describe('package:trust:link:status - tests', () => { expect(result).to.deep.equal(notLinked); expect(sfCommandStubs.log.calledOnce).to.be.true; - expect(sfCommandStubs.log.firstCall.args[0]).to.equal( - 'This org has no trust link request to a Verified PBO. Its status is Not Linked.' - ); + expect(sfCommandStubs.log.firstCall.args[0]).to.contain('Not Linked'); }); it('logs only the timestamps that are set (Pending link, no established/revoked)', async () => { diff --git a/test/commands/package/packageTrustLinkUnlink.test.ts b/test/commands/package/packageTrustLinkUnlink.test.ts index b5565d44..5a856fc6 100644 --- a/test/commands/package/packageTrustLinkUnlink.test.ts +++ b/test/commands/package/packageTrustLinkUnlink.test.ts @@ -58,9 +58,8 @@ describe('package:trust:link:unlink - tests', () => { expect(unlinkStub.calledOnce).to.be.true; expect(sfCommandStubs.log.calledOnce).to.be.true; const logged = sfCommandStubs.log.firstCall.args[0]; - expect(logged).to.equal( - `Removed the trust link to Verified PBO ${verifiedOrgId} (was Pending). This org is now Not Linked.` - ); + expect(logged).to.contain(verifiedOrgId); + expect(logged).to.contain('Pending'); }); it('reports the already Not Linked state when nothing was removed', async () => {