From 610da6a9a5de94c421f5eabdf462f593fba75f85 Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Mon, 17 Mar 2025 13:37:37 -0400 Subject: [PATCH] fix tests --- .../MaterializedViewTargetComponent.test.tsx | 3 ++- src/Explorer/Tree/treeNodeUtil.test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewTargetComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewTargetComponent.test.tsx index 1a6e3cab8..8837bfd68 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewTargetComponent.test.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewTargetComponent.test.tsx @@ -1,11 +1,12 @@ import { Text } from "@fluentui/react"; +import { Collection } from "Contracts/ViewModels"; import { shallow } from "enzyme"; import React from "react"; import { collection } from "../TestUtils"; import { MaterializedViewTargetComponent } from "./MaterializedViewTargetComponent"; describe("MaterializedViewTargetComponent", () => { - let testCollection: any; + let testCollection: Collection; beforeEach(() => { testCollection = { diff --git a/src/Explorer/Tree/treeNodeUtil.test.ts b/src/Explorer/Tree/treeNodeUtil.test.ts index f9298a428..bafda5440 100644 --- a/src/Explorer/Tree/treeNodeUtil.test.ts +++ b/src/Explorer/Tree/treeNodeUtil.test.ts @@ -82,6 +82,7 @@ jest.mock("Explorer/Tree/Trigger", () => { jest.mock("Common/DatabaseAccountUtility", () => { return { isPublicInternetAccessAllowed: () => true, + isMaterializedViewsEnabled: () => false }; }); @@ -134,6 +135,15 @@ const baseCollection = { kind: "hash", version: 2, }, + materializedViews: ko.observable([ + { id: "view1", _rid: "rid1" }, + { id: "view2", _rid: "rid2" }, + ]), + materializedViewDefinition: ko.observable({ + definition: "SELECT * FROM c WHERE c.id = 1", + sourceCollectionId: "source1", + sourceCollectionRid: "rid123", + }), storedProcedures: ko.observableArray([]), userDefinedFunctions: ko.observableArray([]), triggers: ko.observableArray([]),