mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-22 01:24:21 +01:00
fix tests
This commit is contained in:
parent
7812ca4914
commit
610da6a9a5
@ -1,11 +1,12 @@
|
|||||||
import { Text } from "@fluentui/react";
|
import { Text } from "@fluentui/react";
|
||||||
|
import { Collection } from "Contracts/ViewModels";
|
||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { collection } from "../TestUtils";
|
import { collection } from "../TestUtils";
|
||||||
import { MaterializedViewTargetComponent } from "./MaterializedViewTargetComponent";
|
import { MaterializedViewTargetComponent } from "./MaterializedViewTargetComponent";
|
||||||
|
|
||||||
describe("MaterializedViewTargetComponent", () => {
|
describe("MaterializedViewTargetComponent", () => {
|
||||||
let testCollection: any;
|
let testCollection: Collection;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
testCollection = {
|
testCollection = {
|
||||||
|
@ -82,6 +82,7 @@ jest.mock("Explorer/Tree/Trigger", () => {
|
|||||||
jest.mock("Common/DatabaseAccountUtility", () => {
|
jest.mock("Common/DatabaseAccountUtility", () => {
|
||||||
return {
|
return {
|
||||||
isPublicInternetAccessAllowed: () => true,
|
isPublicInternetAccessAllowed: () => true,
|
||||||
|
isMaterializedViewsEnabled: () => false
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -134,6 +135,15 @@ const baseCollection = {
|
|||||||
kind: "hash",
|
kind: "hash",
|
||||||
version: 2,
|
version: 2,
|
||||||
},
|
},
|
||||||
|
materializedViews: ko.observable<DataModels.MaterializedView[]>([
|
||||||
|
{ id: "view1", _rid: "rid1" },
|
||||||
|
{ id: "view2", _rid: "rid2" },
|
||||||
|
]),
|
||||||
|
materializedViewDefinition: ko.observable<DataModels.MaterializedViewDefinition>({
|
||||||
|
definition: "SELECT * FROM c WHERE c.id = 1",
|
||||||
|
sourceCollectionId: "source1",
|
||||||
|
sourceCollectionRid: "rid123",
|
||||||
|
}),
|
||||||
storedProcedures: ko.observableArray([]),
|
storedProcedures: ko.observableArray([]),
|
||||||
userDefinedFunctions: ko.observableArray([]),
|
userDefinedFunctions: ko.observableArray([]),
|
||||||
triggers: ko.observableArray([]),
|
triggers: ko.observableArray([]),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user