mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-01 15:22:08 +00:00
add collection panel improvements (#630)
Co-authored-by: Jordi Bunster <jbunster@microsoft.com>
This commit is contained in:
@@ -3,7 +3,6 @@ import { ActionContracts } from "../Contracts/ExplorerContracts";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import Explorer from "./Explorer";
|
||||
import { handleOpenAction } from "./OpenActions";
|
||||
import AddCollectionPane from "./Panes/AddCollectionPane";
|
||||
import CassandraAddCollectionPane from "./Panes/CassandraAddCollectionPane";
|
||||
|
||||
describe("OpenActions", () => {
|
||||
@@ -15,8 +14,7 @@ describe("OpenActions", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
explorer = {} as Explorer;
|
||||
explorer.addCollectionPane = {} as AddCollectionPane;
|
||||
explorer.addCollectionPane.open = jest.fn();
|
||||
explorer.onNewCollectionClicked = jest.fn();
|
||||
explorer.cassandraAddCollectionPane = {} as CassandraAddCollectionPane;
|
||||
explorer.cassandraAddCollectionPane.open = jest.fn();
|
||||
explorer.closeAllPanes = () => {};
|
||||
@@ -90,24 +88,24 @@ describe("OpenActions", () => {
|
||||
});
|
||||
|
||||
describe("AddCollection pane kind", () => {
|
||||
it("string value should call addCollectionPane.open", () => {
|
||||
it("string value should call explorer.onNewCollectionClicked", () => {
|
||||
const action = {
|
||||
actionType: "OpenPane",
|
||||
paneKind: "AddCollection",
|
||||
};
|
||||
|
||||
const actionHandled = handleOpenAction(action, [], explorer);
|
||||
expect(explorer.addCollectionPane.open).toHaveBeenCalled();
|
||||
expect(explorer.onNewCollectionClicked).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("enum value should call addCollectionPane.open", () => {
|
||||
it("enum value should call explorer.onNewCollectionClicked", () => {
|
||||
const action = {
|
||||
actionType: "OpenPane",
|
||||
paneKind: ActionContracts.PaneKind.AddCollection,
|
||||
};
|
||||
|
||||
const actionHandled = handleOpenAction(action, [], explorer);
|
||||
expect(explorer.addCollectionPane.open).toHaveBeenCalled();
|
||||
expect(explorer.onNewCollectionClicked).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user