mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-20 05:19:28 +01:00
[Query Copilot V2] Unit tests for V2 Copilot (#1580)
* Add tests for V2 of copilot and fix query parameter feature flag * Fix merge changes
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
import { IconButton } from "@fluentui/react";
|
||||
import { shallow } from "enzyme";
|
||||
import { useQueryCopilot } from "hooks/useQueryCopilot";
|
||||
import React from "react";
|
||||
import { Header } from "./Header";
|
||||
|
||||
describe("Header snapshot test", () => {
|
||||
it("should render ", () => {
|
||||
it("should close on button click ", () => {
|
||||
const wrapper = shallow(<Header />);
|
||||
|
||||
const iconButton = wrapper.find(IconButton).first();
|
||||
iconButton.simulate("click", {});
|
||||
|
||||
expect(useQueryCopilot.getState().showCopilotSidebar).toBeFalsy();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user