mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 02:41:39 +00:00
Co-authored-by: Victor Meng <vimeng@microsoft.com> Co-authored-by: Steve Faulkner <stfaul@microsoft.com>
19 lines
845 B
TypeScript
19 lines
845 B
TypeScript
jest.mock("../../../hooks/useDirectories");
|
|
import "@testing-library/jest-dom";
|
|
import { fireEvent, render, screen } from "@testing-library/react";
|
|
import React from "react";
|
|
import { ConnectExplorer } from "./ConnectExplorer";
|
|
|
|
it("shows the connect form", () => {
|
|
const connectionString = "fakeConnectionString";
|
|
const login = jest.fn();
|
|
const setConnectionString = jest.fn();
|
|
const setEncryptedToken = jest.fn();
|
|
const setAuthType = jest.fn();
|
|
|
|
render(<ConnectExplorer {...{ login, setEncryptedToken, setAuthType, connectionString, setConnectionString }} />);
|
|
expect(screen.queryByPlaceholderText("Please enter a connection string")).toBeNull();
|
|
fireEvent.click(screen.getByText("Connect to your account with connection string"));
|
|
expect(screen.queryByPlaceholderText("Please enter a connection string")).toBeDefined();
|
|
});
|