Skip to content

Commit 9c00a2e

Browse files
fix: all form validation tests for WSEditorCLientConfig tests passing
1 parent 47ea124 commit 9c00a2e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/web/src/__tests__/components/WSEditorClientConfig.test.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,32 @@ describe("WSEditorClientConfigDialog", () => {
211211

212212
it("should validate cloud metadata selector index when prefix is provided", async () => {
213213
const user = userEvent.setup();
214+
214215
render(<WSEditorClientConfigDialog workspaceUrl={mockWorkspaceUrl} open={true} onClose={mockOnClose} />);
215216

216217
await waitFor(() => {
217-
expect(screen.getByLabelText("Azure Cloud")).toBeInTheDocument();
218+
expect(screen.getByText("Setup Client Config")).toBeInTheDocument();
218219
});
219220

220-
const azureCloudInput = screen.getByLabelText("Azure Cloud");
221-
await user.type(azureCloudInput, "https://{vaultName}.vault.azure.net");
221+
const azureInput = screen.getByPlaceholderText(
222+
/Endpoint template in Azure Cloud, e.g. https:\/\/\{vaultName\}\.vault\.azure\.net/i,
223+
);
224+
await user.type(azureInput, "https://management.azure.com");
222225

223226
const prefixInput = screen.getByLabelText("Prefix");
224227
await user.type(prefixInput, "https://{vaultName}");
225228

229+
const aadInput = screen.getByPlaceholderText(/Input Microsoft Entra\(AAD\) auth Scope here/i);
230+
await user.type(aadInput, "dummy");
231+
await user.clear(aadInput);
232+
226233
const updateButton = screen.getByText("Update");
227234
await user.click(updateButton);
228235

229236
await waitFor(() => {
230-
expect(screen.getByText("Cloud Metadata Selector Index is required.")).toBeInTheDocument();
237+
expect(
238+
screen.getByText((content) => content.includes("Cloud Metadata Selector Index is required.")),
239+
).toBeInTheDocument();
231240
});
232241
});
233242

0 commit comments

Comments
 (0)