Skip to content

Commit

Permalink
Merge branch 'dev' into readme-changelog-1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed Aug 13, 2024
2 parents dd37cec + 5576e11 commit bb6a548
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/webview/components/kdbNewConnectionView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ export class KdbNewConnectionView extends LitElement {
this.connectionData.connType === 2 ? ServerType.INSIGHTS : ServerType.KDB;
return html`
<div class="row mt-1 mb-1 content-wrapper">
${this.isModalOpen ? this.renderNewLabelModal() : ""}
<div class="col form-wrapper">
<div class="header-text-wrapper">
<div class="row">
Expand Down
21 changes: 17 additions & 4 deletions test/suite/webview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,10 @@ describe("KdbNewConnectionView", () => {
view.connectionData = { connType: 0, serverName: "testServer" };

const result = view.renderEditConnectionForm();

assert.strictEqual(view.isBundledQ, true);
assert.strictEqual(view.oldAlias, "testServer");
assert.strictEqual(view.serverType, ServerType.KDB);
assert.strictEqual(result.values[0].includes("Bundled q"), true);
assert.strictEqual(result.values[1].includes("Bundled q"), true);
});

it("should set isBundledQ to false and return correct HTML when connType is 1", () => {
Expand All @@ -616,7 +615,7 @@ describe("KdbNewConnectionView", () => {
assert.strictEqual(view.isBundledQ, false);
assert.strictEqual(view.oldAlias, "testServer");
assert.strictEqual(view.serverType, ServerType.KDB);
assert.strictEqual(result.values[0].includes("My q"), true);
assert.strictEqual(result.values[1].includes("My q"), true);
});

it("should set serverType to INSIGHTS and return correct HTML when connType is 2", () => {
Expand All @@ -627,7 +626,21 @@ describe("KdbNewConnectionView", () => {
assert.strictEqual(view.isBundledQ, false);
assert.strictEqual(view.oldAlias, "testServer");
assert.strictEqual(view.serverType, ServerType.INSIGHTS);
assert.strictEqual(result.values[0].includes("Insights"), true);
assert.strictEqual(result.values[1].includes("Insights"), true);
});

it("should set serverType to INSIGHTS and open labels modal", () => {
view.connectionData = { connType: 2, serverName: "testServer" };
view.openModal();

const result = view.renderEditConnectionForm();
const resultsStrings = JSON.stringify(result);

assert.strictEqual(view.isBundledQ, false);
assert.strictEqual(view.oldAlias, "testServer");
assert.strictEqual(view.serverType, ServerType.INSIGHTS);
assert.strictEqual(result.values[1].includes("Insights"), true);
assert.strictEqual(resultsStrings.includes("Add a New Label"), true);
});
});

Expand Down

0 comments on commit bb6a548

Please sign in to comment.