Skip to content

Commit 610da6a

Browse files
author
Asier Isayas
committed
fix tests
1 parent 7812ca4 commit 610da6a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Explorer/Controls/Settings/SettingsSubComponents/MaterializedViewTargetComponent.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Text } from "@fluentui/react";
2+
import { Collection } from "Contracts/ViewModels";
23
import { shallow } from "enzyme";
34
import React from "react";
45
import { collection } from "../TestUtils";
56
import { MaterializedViewTargetComponent } from "./MaterializedViewTargetComponent";
67

78
describe("MaterializedViewTargetComponent", () => {
8-
let testCollection: any;
9+
let testCollection: Collection;
910

1011
beforeEach(() => {
1112
testCollection = {

src/Explorer/Tree/treeNodeUtil.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jest.mock("Explorer/Tree/Trigger", () => {
8282
jest.mock("Common/DatabaseAccountUtility", () => {
8383
return {
8484
isPublicInternetAccessAllowed: () => true,
85+
isMaterializedViewsEnabled: () => false
8586
};
8687
});
8788

@@ -134,6 +135,15 @@ const baseCollection = {
134135
kind: "hash",
135136
version: 2,
136137
},
138+
materializedViews: ko.observable<DataModels.MaterializedView[]>([
139+
{ id: "view1", _rid: "rid1" },
140+
{ id: "view2", _rid: "rid2" },
141+
]),
142+
materializedViewDefinition: ko.observable<DataModels.MaterializedViewDefinition>({
143+
definition: "SELECT * FROM c WHERE c.id = 1",
144+
sourceCollectionId: "source1",
145+
sourceCollectionRid: "rid123",
146+
}),
137147
storedProcedures: ko.observableArray([]),
138148
userDefinedFunctions: ko.observableArray([]),
139149
triggers: ko.observableArray([]),

0 commit comments

Comments
 (0)