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

@@ -9,7 +9,6 @@ import DeleteFeedback from "../../Common/DeleteFeedback";
import DocumentClientUtilityBase from "../../Common/DocumentClientUtilityBase";
import Explorer from "../Explorer";
import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
import { DatabaseStub } from "../OpenActionsStubs";
import { TreeNode } from "../../Contracts/ViewModels";
describe("Delete Collection Confirmation Pane", () => {
@@ -21,14 +20,14 @@ describe("Delete Collection Confirmation Pane", () => {
});
it("should be true if 1 database and 1 collection", () => {
let database: ViewModels.Database = new DatabaseStub({});
let database = {} as ViewModels.Database;
database.collections = ko.observableArray<ViewModels.Collection>([{} as ViewModels.Collection]);
explorer.databases = ko.observableArray<ViewModels.Database>([database]);
expect(explorer.isLastCollection()).toBe(true);
});
it("should be false if if 1 database and 2 collection", () => {
let database: ViewModels.Database = new DatabaseStub({});
let database = {} as ViewModels.Database;
database.collections = ko.observableArray<ViewModels.Collection>([
{} as ViewModels.Collection,
{} as ViewModels.Collection
@@ -38,16 +37,16 @@ describe("Delete Collection Confirmation Pane", () => {
});
it("should be false if 2 database and 1 collection each", () => {
let database: ViewModels.Database = new DatabaseStub({});
let database = {} as ViewModels.Database;
database.collections = ko.observableArray<ViewModels.Collection>([{} as ViewModels.Collection]);
let database2: ViewModels.Database = new DatabaseStub({});
let database2 = {} as ViewModels.Database;
database2.collections = ko.observableArray<ViewModels.Collection>([{} as ViewModels.Collection]);
explorer.databases = ko.observableArray<ViewModels.Database>([database, database2]);
expect(explorer.isLastCollection()).toBe(false);
});
it("should be false if 0 databases", () => {
let database: ViewModels.Database = new DatabaseStub({});
let database = {} as ViewModels.Database;
explorer.databases = ko.observableArray<ViewModels.Database>();
database.collections = ko.observableArray<ViewModels.Collection>();
expect(explorer.isLastCollection()).toBe(false);