fix: update null check and remove typo
This commit is contained in:
@@ -13,7 +13,7 @@ type TestVariables = Readonly<{
|
|||||||
admin_password?: string;
|
admin_password?: string;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
function findWindowsRpdScript(state: TerraformState): string | null {
|
function findWindowsRdpScript(state: TerraformState): string | null {
|
||||||
for (const resource of state.resources) {
|
for (const resource of state.resources) {
|
||||||
const isRdpScriptResource =
|
const isRdpScriptResource =
|
||||||
resource.type === "coder_script" && resource.name === "windows-rdp";
|
resource.type === "coder_script" && resource.name === "windows-rdp";
|
||||||
@@ -50,8 +50,8 @@ describe("Web RDP", async () => {
|
|||||||
resource_id: "bar",
|
resource_id: "bar",
|
||||||
});
|
});
|
||||||
|
|
||||||
const lines = findWindowsRpdScript(state)
|
const lines = findWindowsRdpScript(state)
|
||||||
.split("\n")
|
?.split("\n")
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.map((line) => line.trim());
|
.map((line) => line.trim());
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ describe("Web RDP", async () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const defaultRdpScript = findWindowsRpdScript(defaultState);
|
const defaultRdpScript = findWindowsRdpScript(defaultState);
|
||||||
expect(defaultRdpScript).toBeString();
|
expect(defaultRdpScript).toBeString();
|
||||||
|
|
||||||
const { username: defaultUsername, password: defaultPassword } =
|
const { username: defaultUsername, password: defaultPassword } =
|
||||||
@@ -118,7 +118,7 @@ describe("Web RDP", async () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const customRdpScript = findWindowsRpdScript(customizedState);
|
const customRdpScript = findWindowsRdpScript(customizedState);
|
||||||
expect(customRdpScript).toBeString();
|
expect(customRdpScript).toBeString();
|
||||||
|
|
||||||
const { username: customUsername, password: customPassword } =
|
const { username: customUsername, password: customPassword } =
|
||||||
|
|||||||
Reference in New Issue
Block a user