mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-22 19:22:25 +01:00
Remove Phoenix and notebooks (Phase 5) (#2561)
* Remove Phoenix and notebook core Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e4f2ebd-f2f8-4c2b-b63d-40e1a2b1c662 * Fix merge issue. --------- Copilot-Session: 4e4f2ebd-f2f8-4c2b-b63d-40e1a2b1c662
This commit is contained in:
@@ -10,6 +10,7 @@ import { Capability, DatabaseAccount } from "../Contracts/DataModels";
|
||||
import { updateUserContext, userContext } from "../UserContext";
|
||||
import { update } from "../Utils/arm/generatedClients/cosmos/databaseAccounts";
|
||||
import Explorer from "./Explorer";
|
||||
import { useCommandBar } from "./Menus/CommandBar/CommandBarComponentAdapter";
|
||||
|
||||
const mockUpdate = update as jest.MockedFunction<typeof update>;
|
||||
|
||||
@@ -26,21 +27,6 @@ jest.mock("./Controls/Dialog", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
// Silence useNotebook subscription calls
|
||||
jest.mock("./Notebook/useNotebook", () => ({
|
||||
useNotebook: {
|
||||
subscribe: jest.fn(),
|
||||
getState: jest.fn().mockReturnValue(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get: () => jest.fn().mockResolvedValue(undefined),
|
||||
},
|
||||
),
|
||||
),
|
||||
},
|
||||
}));
|
||||
|
||||
describe("Explorer.openEnableSynapseLinkDialog", () => {
|
||||
let explorer: Explorer;
|
||||
|
||||
@@ -69,6 +55,7 @@ describe("Explorer.openEnableSynapseLinkDialog", () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
mockUpdate.mockResolvedValue(undefined);
|
||||
useCommandBar.getState().setIsSynapseLinkUpdating(false);
|
||||
explorer = new Explorer();
|
||||
});
|
||||
|
||||
@@ -102,6 +89,19 @@ describe("Explorer.openEnableSynapseLinkDialog", () => {
|
||||
|
||||
expect(userContext.databaseAccount.properties.enableAnalyticalStorage).toBe(true);
|
||||
});
|
||||
|
||||
it("should track Synapse Link update progress in the command bar store", async () => {
|
||||
mockUpdate.mockImplementation(async () => {
|
||||
expect(useCommandBar.getState().isSynapseLinkUpdating).toBe(true);
|
||||
return {} as Awaited<ReturnType<typeof update>>;
|
||||
});
|
||||
explorer.openEnableSynapseLinkDialog();
|
||||
|
||||
const dialogProps = mockOpenDialog.mock.calls[0][0];
|
||||
await dialogProps.onPrimaryButtonClick();
|
||||
|
||||
expect(useCommandBar.getState().isSynapseLinkUpdating).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("with targetAccountOverride", () => {
|
||||
|
||||
Reference in New Issue
Block a user