Skip to content

Commit

Permalink
test: change regex to match new table rd II
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Oct 24, 2024
1 parent af37bcf commit 6191625
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions src/commands/package/version/create/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,47 +61,47 @@ export class PackageVersionCreateReportCommand extends SfCommand<ReportCommandRe

const data = [
{
key: pvclMessages.getMessage('id'),
name: pvclMessages.getMessage('id'),
value: record.Id,
},
{
key: pvclMessages.getMessage('status'),
name: pvclMessages.getMessage('status'),
value: camelCaseToTitleCase(record.Status),
},
{
key: pvclMessages.getMessage('package-id'),
name: pvclMessages.getMessage('package-id'),
value: record.Package2Id,
},
{
key: pvclMessages.getMessage('packageVersionId'),
name: pvclMessages.getMessage('packageVersionId'),
value: record.Package2VersionId,
},
{
key: pvclMessages.getMessage('subscriberPackageVersionId'),
name: pvclMessages.getMessage('subscriberPackageVersionId'),
value: record.SubscriberPackageVersionId,
},
{
key: pvclMessages.getMessage('tag'),
name: pvclMessages.getMessage('tag'),
value: record.Tag,
},
{
key: pvclMessages.getMessage('branch'),
name: pvclMessages.getMessage('branch'),
value: record.Branch,
},
{ key: 'Created Date', value: record.CreatedDate },
{ name: 'Created Date', value: record.CreatedDate },
{
key: pvclMessages.getMessage('installUrl'),
name: pvclMessages.getMessage('installUrl'),
value: installUrlValue,
},
{
key: plMessages.getMessage('createdBy'),
name: plMessages.getMessage('createdBy'),
value: record.CreatedBy,
},
];

if (record.ConvertedFromVersionId) {
data.push({
key: pvlMessages.getMessage('convertedFromVersionId'),
name: pvlMessages.getMessage('convertedFromVersionId'),
value: record.ConvertedFromVersionId,
});
}
Expand Down
4 changes: 2 additions & 2 deletions test/commands/package/packageList.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ describe('package list', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Packages');
let headerExpression =
'Namespace Prefix\\s+?Name\\s+?Id\\s+?Alias\\s+?Description\\s+?Type\\s+?Subscriber Package Id\\s+?Converted From Package Id\\s+?Org-Dependent Unlocked Package\\s+?Error Notification Username\\s+?Created By\\s+?App Analytics Enabled';
'Namespace Prefix\\s+?|Name\\s+?|Id\\s+?|Alias\\s+?|Description\\s+?|Type\\s+?|Subscriber Package Id\\s+?|Converted From Package Id\\s+?|Org-Dependent Unlocked Package\\s+?|Error Notification Username\\s+?|Created By\\s+?|App Analytics Enabled';
if (apiVersion < 59.0) {
headerExpression = headerExpression.replace('App Analytics Enabled\\s+?', '');
headerExpression = headerExpression.replace('App Analytics Enabled\\s+?|', '');
}
expect(output).to.match(new RegExp(headerExpression));
});
Expand Down
18 changes: 9 additions & 9 deletions test/commands/package/packageVersion.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Version Create Requests [');
expect(output).to.match(
/ Id\s+Status\s+Package Id\s+Package Version Id\s+Subscriber Package Version Id\s+Tag\s+Branch\s+Created Date\s+Created By\s+/
/ Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|/
);
});

Expand Down Expand Up @@ -242,7 +242,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Version Create Requests [');
expect(output).to.match(
/ Id\s+Status\s+Package Id\s+Package Version Id\s+Subscriber Package Version Id\s+Tag\s+Branch\s+Created Date\s+Created By\s+Converted From Version Id\s+/
/ Id\s+?|Status\s+?|Package Id\s+?|Package Version Id\s+?|Subscriber Package Version Id\s+?|Tag\s+?|Branch\s+?|Created Date\s+?|Created By\s+?|Converted From Version Id\s+?|/
);
});
it('should list the package versions created --verbose (json)', async () => {
Expand All @@ -262,39 +262,39 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/
);
});

it('should list package versions in dev hub - concise output', () => {
const command = `package:version:list -v ${session.hubOrg.username} --concise`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(/Package Id\s+Version\s+Subscriber Package Version Id\s+Released/);
expect(output).to.match(/Package Id\s+?|Version\s+?|Subscriber Package Version Id\s+?|Released/);
});

it('should list package versions modified in the last 5 days', () => {
const command = `package:version:list -v ${session.hubOrg.username} --modified-last-days 5`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/
);
});
it('should list package versions created in the last 5 days', () => {
const command = `package:version:list -v ${session.hubOrg.username} --createdlastdays 5`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch/
);
});
it('should list installed packages in dev hub - verbose human readable results', () => {
const command = `package:version:list -v ${session.hubOrg.username} --verbose`;
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/
);
});

Expand All @@ -303,7 +303,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Package Id\s+Installation URL\s+Package Version Id\s+Created Date\s+Last Modified Date\s+Tag\s+Description\s+Code Coverage\s+Code Coverage Met\s+Converted From Version Id\s+Org-Dependent\s+Unlocked Package\s+Release\s+Version\s+Build Duration in Seconds\s+Managed Metadata Removed\s+Created By/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Package Id\s+?|Installation URL\s+?|Package Version Id\s+?|Created Date\s+?|Last Modified Date\s+?|Tag\s+?|Description\s+?|Code Coverage\s+?|Code Coverage Met\s+?|Converted From Version Id\s+?|Org-Dependent\s+?|Unlocked Package\s+?|Release\s+?|Version\s+?|Build Duration in Seconds\s+?|Managed Metadata Removed\s+?|Created By/
);
expect(output).to.include('testing');
});
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('package:version:*', () => {
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
expect(output).to.contain('=== Package Versions [');
expect(output).to.match(
/Package Name\s+Namespace\s+Version Name\s+Version\s+Subscriber Package Version Id\sAlias\s+Installation Key\s+Released\s+Validation Skipped\s+Validated Async\s+Ancestor\s+Ancestor Version\s+Branch\s+Converted From Version Id/
/Package Name\s+?|Namespace\s+?|Version Name\s+?|Version\s+?|Subscriber Package Version Id\sAlias\s+?|Installation Key\s+?|Released\s+?|Validation Skipped\s+?|Validated Async\s+?|Ancestor\s+?|Ancestor Version\s+?|Branch\s+?|Converted From Version Id/
);
});
});
Expand Down

0 comments on commit 6191625

Please sign in to comment.