Remove OpenActionsStubs (#106)

This commit is contained in:
Steve Faulkner
2020-07-21 13:50:51 -05:00
committed by GitHub
parent 46cca859e3
commit 4f86015be7
29 changed files with 157 additions and 681 deletions

View File

@@ -2,21 +2,22 @@ import * as ko from "knockout";
import * as Constants from "../../Common/Constants";
import * as ViewModels from "../../Contracts/ViewModels";
import Explorer from "../Explorer";
import { CollectionStub, DatabaseStub } from "../../Explorer/OpenActionsStubs";
import QueryTab from "./QueryTab";
import { View } from "@nteract/data-explorer/lib/utilities/types";
import { PartitionKey } from "../../Contracts/DataModels";
describe("Query Tab", () => {
function getNewQueryTabForContainer(container: Explorer): ViewModels.QueryTab {
const database: ViewModels.Database = new DatabaseStub({
const database = {
container: container,
id: ko.observable<string>("test"),
isDatabaseShared: () => false
});
const collection: ViewModels.Collection = new CollectionStub({
} as ViewModels.Database;
const collection = {
container: container,
databaseId: "test",
id: ko.observable<string>("test")
});
} as ViewModels.Collection;
return new QueryTab({
tabKind: ViewModels.CollectionTabKind.Query,
@@ -33,19 +34,12 @@ describe("Query Tab", () => {
}
describe("shouldSetSystemPartitionKeyContainerPartitionKeyValueUndefined", () => {
const collection: ViewModels.Collection = new CollectionStub({
id: "withoutsystempk",
const collection = {
id: ko.observable<string>("withoutsystempk"),
partitionKey: {
systemKey: true
}
});
const collectionSystemPK: ViewModels.Collection = new CollectionStub({
id: "withsystempk",
partitionKey: {
systemKey: true
}
});
} as ViewModels.Collection;
it("no container with system pk, should not set partition key option", () => {
const iteratorOptions = QueryTab.getIteratorOptions(collection);