Skip to content

Commit 2228651

Browse files
Fix capitalization error with Schema Compare Controller that is causing console log error (#18691)
* Fix bug in schema controller start method * Rename schema compare test
1 parent e70e2a6 commit 2228651

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

src/schemaCompare/schemaCompareWebViewController.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class SchemaCompareWebViewController extends ReactWebviewPanelController<
106106
let source: mssql.SchemaCompareEndpointInfo;
107107

108108
let connectionProfile: IConnectionProfile | undefined = sourceContext
109-
? (sourceContext.ConnectionInfo as IConnectionProfile)
109+
? (sourceContext.connectionInfo as IConnectionProfile)
110110
: undefined;
111111

112112
if (connectionProfile) {

test/unit/schemaCompareWebViewController.test.ts

+44
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,50 @@ suite("SchemaCompareWebViewController Tests", () => {
246246
);
247247
});
248248

249+
test("start - called with sqlproject path - sets sourceEndpointInfo correctly", () => {
250+
const mockSqlProjectNode = {
251+
treeDataProvider: {
252+
roots: [
253+
{
254+
projectFileUri: {
255+
fsPath: "c:\\TestSqlProject\\TestProject.sqlproj",
256+
},
257+
},
258+
],
259+
},
260+
};
261+
262+
const scController = new SchemaCompareWebViewController(
263+
mockContext,
264+
vscodeWrapper.object,
265+
mockSqlProjectNode,
266+
mockSchemaCompareService.object,
267+
mockConnectionManager.object,
268+
deploymentOptionsResultMock,
269+
schemaCompareWebViewTitle,
270+
);
271+
272+
const expected = {
273+
endpointType: 2,
274+
packageFilePath: "",
275+
serverDisplayName: "",
276+
serverName: "",
277+
databaseName: "",
278+
ownerUri: "",
279+
connectionDetails: undefined,
280+
projectFilePath: "c:\\TestSqlProject\\TestProject.sqlproj",
281+
targetScripts: [],
282+
dataSchemaProvider: undefined,
283+
extractTarget: 5,
284+
};
285+
286+
assert.deepEqual(
287+
scController.state.sourceEndpointInfo,
288+
expected,
289+
"sourceEndpointInfo should match the expected path",
290+
);
291+
});
292+
249293
test("compare reducer - when called - completes successfully", async () => {
250294
const expectedCompareResultMock: mssql.SchemaCompareResult = {
251295
operationId: "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE",

0 commit comments

Comments
 (0)