Skip to content

Commit 0ae3005

Browse files
@W-20893693: REbasing from main
1 parent afff2e1 commit 0ae3005

3 files changed

Lines changed: 4 additions & 27 deletions

File tree

packages/b2c-cli/test/commands/docs/search.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,9 @@ import {ux} from '@oclif/core';
88
import {expect} from 'chai';
99
import {afterEach, beforeEach} from 'mocha';
1010
import sinon from 'sinon';
11-
import type {DocEntry, SearchResult} from '@salesforce/b2c-tooling-sdk/operations/docs';
1211
import DocsSearch from '../../../src/commands/docs/search.js';
1312
import {createIsolatedConfigHooks, createTestCommand, runSilent} from '../../helpers/test-setup.js';
1413

15-
interface ListDocsResponse {
16-
entries: DocEntry[];
17-
}
18-
19-
interface SearchDocsResponse {
20-
query?: string;
21-
results: SearchResult[];
22-
}
23-
2414
describe('docs search', () => {
2515
const hooks = createIsolatedConfigHooks();
2616

@@ -53,7 +43,7 @@ describe('docs search', () => {
5343
const listStub = sinon.stub().returns([{id: 'a', title: 'A', filePath: 'a.md'}]);
5444
command.operations = {...command.operations, listDocs: listStub};
5545

56-
const result = await runSilent<ListDocsResponse>(() => command.run());
46+
const result = (await runSilent(() => command.run())) as {entries: unknown[]};
5747

5848
expect(result.entries).to.have.length(1);
5949
});
@@ -79,7 +69,7 @@ describe('docs search', () => {
7969
const searchStub = sinon.stub().returns([{entry: {id: 'a', title: 'A', filePath: 'a.md'}, score: 0.1}]);
8070
command.operations = {...command.operations, searchDocs: searchStub};
8171

82-
const result = await runSilent<SearchDocsResponse>(() => command.run());
72+
const result = (await runSilent(() => command.run())) as {results: unknown[]};
8373

8474
expect(result.results).to.have.length(1);
8575
});

packages/b2c-cli/test/commands/ecdn/security/get.test.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@
66
import {expect} from 'chai';
77
import {afterEach, beforeEach} from 'mocha';
88
import sinon from 'sinon';
9-
import type {CdnZonesComponents} from '@salesforce/b2c-tooling-sdk/clients';
109
import EcdnSecurityGet from '../../../../src/commands/ecdn/security/get.js';
1110
import {createIsolatedConfigHooks, createTestCommand, runSilent} from '../../../helpers/test-setup.js';
1211

13-
type SecuritySetting = CdnZonesComponents['schemas']['SecuritySetting'];
14-
15-
interface GetOutput {
16-
settings: SecuritySetting;
17-
}
18-
1912
/**
2013
* Unit tests for eCDN security get command CLI logic.
2114
* Tests output formatting and error handling.
@@ -105,7 +98,7 @@ describe('ecdn security get', () => {
10598
}),
10699
});
107100

108-
const result = await runSilent<GetOutput>(() => command.run());
101+
const result = (await runSilent(() => command.run())) as {settings: {securityLevel: string; wafEnabled: boolean}};
109102

110103
expect(result.settings.securityLevel).to.equal('high');
111104
expect(result.settings.wafEnabled).to.be.true;

packages/b2c-cli/test/commands/ecdn/zones/list.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@
66
import {expect} from 'chai';
77
import {afterEach, beforeEach} from 'mocha';
88
import sinon from 'sinon';
9-
import type {Zone} from '@salesforce/b2c-tooling-sdk/clients';
109
import EcdnZonesList from '../../../../src/commands/ecdn/zones/list.js';
1110
import {createIsolatedConfigHooks, createTestCommand, runSilent} from '../../../helpers/test-setup.js';
1211

13-
interface ListOutput {
14-
zones: Zone[];
15-
total: number;
16-
}
17-
1812
/**
1913
* Unit tests for eCDN zones list command CLI logic.
2014
* Tests output formatting, column selection, and error handling.
@@ -135,7 +129,7 @@ describe('ecdn zones list', () => {
135129
}),
136130
});
137131

138-
const result = await runSilent<ListOutput>(() => command.run());
132+
const result = (await runSilent(() => command.run())) as {total: number; zones: Array<{name: string}>};
139133

140134
expect(result).to.have.property('total', 1);
141135
expect(result.zones).to.have.lengthOf(1);

0 commit comments

Comments
 (0)