Skip to content

Commit 752272b

Browse files
committed
test: Fix ClineProvider extensionUri fixtures
Update the ClineProvider webview test contexts to include extensionUri.fsPath so marketplace initialization matches the current production code path. This fixes the shared failing test cascade caused by RemoteConfigLoader receiving an undefined extension path during test setup.
1 parent f947a85 commit 752272b

6 files changed

Lines changed: 11 additions & 11 deletions

‎src/core/webview/__tests__/ClineProvider.apiHandlerRebuild.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe("ClineProvider - API Handler Rebuild Guard", () => {
157157

158158
mockContext = {
159159
extensionPath: "/test/path",
160-
extensionUri: {} as vscode.Uri,
160+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
161161
globalState: {
162162
get: vi.fn().mockImplementation((key: string) => globalState[key]),
163163
update: vi.fn().mockImplementation((key: string, value: any) => (globalState[key] = value)),

‎src/core/webview/__tests__/ClineProvider.lockApiConfig.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ describe("ClineProvider - Lock API Config Across Modes", () => {
239239

240240
mockContext = {
241241
extensionPath: "/test/path",
242-
extensionUri: {} as vscode.Uri,
242+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
243243
globalState: {
244244
get: vi.fn().mockImplementation((key: string) => globalState[key]),
245245
update: vi.fn().mockImplementation((key: string, value: unknown) => {

‎src/core/webview/__tests__/ClineProvider.spec.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ describe("ClineProvider", () => {
360360

361361
mockContext = {
362362
extensionPath: "/test/path",
363-
extensionUri: {} as vscode.Uri,
363+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
364364
globalState: {
365365
get: vi.fn().mockImplementation((key: string) => globalState[key]),
366366
update: vi
@@ -2027,7 +2027,7 @@ describe("Project MCP Settings", () => {
20272027

20282028
mockContext = {
20292029
extensionPath: "/test/path",
2030-
extensionUri: {} as vscode.Uri,
2030+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
20312031
globalState: {
20322032
get: vi.fn(),
20332033
update: vi.fn(),
@@ -2179,7 +2179,7 @@ describe.skip("ContextProxy integration", () => {
21792179
keys: vi.fn().mockReturnValue([]),
21802180
},
21812181
secrets: { get: vi.fn(), store: vi.fn(), delete: vi.fn() },
2182-
extensionUri: {} as vscode.Uri,
2182+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
21832183
globalStorageUri: { fsPath: "/test/path" },
21842184
extension: { packageJSON: { version: "1.0.0" } },
21852185
} as unknown as vscode.ExtensionContext
@@ -2249,7 +2249,7 @@ describe("getTelemetryProperties", () => {
22492249
keys: vi.fn().mockReturnValue([]),
22502250
},
22512251
secrets: { get: vi.fn(), store: vi.fn(), delete: vi.fn() },
2252-
extensionUri: {} as vscode.Uri,
2252+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
22532253
globalStorageUri: { fsPath: "/test/path" },
22542254
extension: { packageJSON: { version: "1.0.0" } },
22552255
} as unknown as vscode.ExtensionContext
@@ -2397,7 +2397,7 @@ describe("ClineProvider - Router Models", () => {
23972397

23982398
mockContext = {
23992399
extensionPath: "/test/path",
2400-
extensionUri: {} as vscode.Uri,
2400+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
24012401
globalState: {
24022402
get: vi.fn().mockImplementation((key: string) => globalState[key]),
24032403
update: vi
@@ -2710,7 +2710,7 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
27102710

27112711
mockContext = {
27122712
extensionPath: "/test/path",
2713-
extensionUri: {} as vscode.Uri,
2713+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
27142714
globalState: {
27152715
get: vi.fn().mockImplementation((key: string) => globalState[key]),
27162716
update: vi

‎src/core/webview/__tests__/ClineProvider.sticky-mode.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ describe("ClineProvider - Sticky Mode", () => {
217217

218218
mockContext = {
219219
extensionPath: "/test/path",
220-
extensionUri: {} as vscode.Uri,
220+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
221221
globalState: {
222222
get: vi.fn().mockImplementation((key: string) => globalState[key]),
223223
update: vi.fn().mockImplementation((key: string, value: string | undefined) => {

‎src/core/webview/__tests__/ClineProvider.sticky-profile.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe("ClineProvider - Sticky Provider Profile", () => {
222222

223223
mockContext = {
224224
extensionPath: "/test/path",
225-
extensionUri: {} as vscode.Uri,
225+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
226226
globalState: {
227227
get: vi.fn().mockImplementation((key: string) => globalState[key]),
228228
update: vi.fn().mockImplementation((key: string, value: string | undefined) => {

‎src/core/webview/__tests__/ClineProvider.taskHistory.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ describe("ClineProvider Task History Synchronization", () => {
264264

265265
mockContext = {
266266
extensionPath: "/test/path",
267-
extensionUri: {} as vscode.Uri,
267+
extensionUri: { fsPath: "/test/path" } as vscode.Uri,
268268
globalState: {
269269
get: vi.fn().mockImplementation((key: string) => globalState[key]),
270270
update: vi.fn().mockImplementation((key: string, value: any) => {

0 commit comments

Comments
 (0)