Skip to content

Commit db9f42b

Browse files
test: try against SO, enable publication
1 parent cf80719 commit db9f42b

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

test/nuts/agent.generate.authoring-bundle.nut.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ describe('agent generate authoring-bundle NUTs', () => {
3030
sourceDir: join('test', 'mock-projects', 'agent-generate-template'),
3131
},
3232
devhubAuthStrategy: 'AUTO',
33-
// scratchOrgs: [
34-
// {
35-
// setDefault: true,
36-
// config: join('config', 'project-scratch-def.json'),
37-
// },
38-
// ],
33+
scratchOrgs: [
34+
{
35+
setDefault: true,
36+
config: join('config', 'project-scratch-def.json'),
37+
},
38+
],
3939
});
4040
});
4141

@@ -48,8 +48,7 @@ describe('agent generate authoring-bundle NUTs', () => {
4848
const bundleName = 'Test_Bundle';
4949

5050
it('should generate authoring bundle from spec file', async () => {
51-
// until we're testing in scratch orgs, use the devhub
52-
const username = session.hubOrg.username;
51+
const username = session.orgs.get('default')!.username as string;
5352
const specPath = join(session.project.dir, 'specs', specFileName);
5453

5554
// First generate a spec file

test/nuts/agent.publish.nut.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { TestSession } from '@salesforce/cli-plugins-testkit';
1919
import { execCmd } from '@salesforce/cli-plugins-testkit';
2020
import type { AgentPublishAuthoringBundleResult } from '../../src/commands/agent/publish/authoring-bundle.js';
2121

22-
describe.skip('agent publish authoring-bundle NUTs', () => {
22+
describe('agent publish authoring-bundle NUTs', () => {
2323
let session: TestSession;
2424

2525
before(async () => {
@@ -42,10 +42,11 @@ describe.skip('agent publish authoring-bundle NUTs', () => {
4242
});
4343

4444
it('should publish a valid authoring bundle', () => {
45-
const bundlePath = join(session.project.dir, 'force-app', 'main', 'default', 'aiAuthoringBundles');
45+
const username = session.orgs.get('default')!.username as string;
46+
const bundleApiName = 'Local_Info_Agent';
4647

4748
const result = execCmd<AgentPublishAuthoringBundleResult>(
48-
`agent publish authoring-bundle --api-name ${bundlePath} --json`,
49+
`agent publish authoring-bundle --api-name ${bundleApiName} --target-org ${username} --json`,
4950
{ ensureExitCode: 0 }
5051
).jsonOutput?.result;
5152

test/nuts/agent.validate.nut.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ describe('agent validate authoring-bundle NUTs', () => {
2828
sourceDir: join('test', 'mock-projects', 'agent-generate-template'),
2929
},
3030
devhubAuthStrategy: 'AUTO',
31-
// scratchOrgs: [
32-
// {
33-
// setDefault: true,
34-
// config: join('config', 'project-scratch-def.json'),
35-
// },
36-
// ],
31+
scratchOrgs: [
32+
{
33+
setDefault: true,
34+
config: join('config', 'project-scratch-def.json'),
35+
},
36+
],
3737
});
3838
});
3939

@@ -42,8 +42,7 @@ describe('agent validate authoring-bundle NUTs', () => {
4242
});
4343

4444
it('should validate a valid authoring bundle', () => {
45-
// until we're testing in scratch orgs, use the devhub
46-
const username = session.hubOrg.username;
45+
const username = session.orgs.get('default')!.username as string;
4746

4847
const result = execCmd<AgentValidateAuthoringBundleResult>(
4948
`agent validate authoring-bundle --api-name valid --target-org ${username} --json`,
@@ -56,8 +55,7 @@ describe('agent validate authoring-bundle NUTs', () => {
5655
});
5756

5857
it('should fail validation for invalid bundle path', () => {
59-
// until we're testing in scratch orgs, use the devhub
60-
const username = session.hubOrg.username;
58+
const username = session.orgs.get('default')!.username as string;
6159
const result = execCmd<AgentValidateAuthoringBundleResult>(
6260
`agent validate authoring-bundle --api-name invalid --target-org ${username} --json`,
6361
{ ensureExitCode: 2 }

0 commit comments

Comments
 (0)