mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-24 12:14:17 +00:00
Migrated Hosted Explorer to React (#360)
Co-authored-by: Victor Meng <vimeng@microsoft.com> Co-authored-by: Steve Faulkner <stfaul@microsoft.com>
This commit is contained in:
17
src/Platform/Hosted/Components/MeControl.test.tsx
Normal file
17
src/Platform/Hosted/Components/MeControl.test.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
jest.mock("../../../hooks/useDirectories");
|
||||
import "@testing-library/jest-dom";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { MeControl } from "./MeControl";
|
||||
import { Account } from "msal";
|
||||
|
||||
it("renders", () => {
|
||||
const account = {} as Account;
|
||||
const logout = jest.fn();
|
||||
const openPanel = jest.fn();
|
||||
|
||||
render(<MeControl graphToken="" account={account} logout={logout} openPanel={openPanel} />);
|
||||
fireEvent.click(screen.getByRole("button"));
|
||||
expect(screen.getByText("Switch Directory")).toBeDefined();
|
||||
expect(screen.getByText("Sign Out")).toBeDefined();
|
||||
});
|
||||
Reference in New Issue
Block a user