Remvoe Explorer.subscriptionType (#622)

This commit is contained in:
Steve Faulkner
2021-04-06 14:35:14 -05:00
committed by GitHub
parent cb7760b3f6
commit 0f88176a27
10 changed files with 32 additions and 46 deletions

View File

@@ -1,8 +1,9 @@
import * as Constants from "../../Common/Constants";
import { DatabaseAccount } from "../../Contracts/DataModels";
import { SubscriptionType } from "../../Contracts/SubscriptionType";
import { updateUserContext } from "../../UserContext";
import Explorer from "../Explorer";
import AddDatabasePane from "./AddDatabasePane";
import { DatabaseAccount } from "../../Contracts/DataModels";
describe("Add Database Pane", () => {
describe("getSharedThroughputDefault()", () => {
@@ -44,31 +45,41 @@ describe("Add Database Pane", () => {
});
it("should be true if subscription type is Benefits", () => {
explorer.subscriptionType(SubscriptionType.Benefits);
updateUserContext({
subscriptionType: SubscriptionType.Benefits,
});
const addDatabasePane = explorer.addDatabasePane as AddDatabasePane;
expect(addDatabasePane.getSharedThroughputDefault()).toBe(true);
});
it("should be false if subscription type is EA", () => {
explorer.subscriptionType(SubscriptionType.EA);
updateUserContext({
subscriptionType: SubscriptionType.EA,
});
const addDatabasePane = explorer.addDatabasePane as AddDatabasePane;
expect(addDatabasePane.getSharedThroughputDefault()).toBe(false);
});
it("should be true if subscription type is Free", () => {
explorer.subscriptionType(SubscriptionType.Free);
updateUserContext({
subscriptionType: SubscriptionType.Free,
});
const addDatabasePane = explorer.addDatabasePane as AddDatabasePane;
expect(addDatabasePane.getSharedThroughputDefault()).toBe(true);
});
it("should be true if subscription type is Internal", () => {
explorer.subscriptionType(SubscriptionType.Internal);
updateUserContext({
subscriptionType: SubscriptionType.Internal,
});
const addDatabasePane = explorer.addDatabasePane as AddDatabasePane;
expect(addDatabasePane.getSharedThroughputDefault()).toBe(true);
});
it("should be true if subscription type is PAYG", () => {
explorer.subscriptionType(SubscriptionType.PAYG);
updateUserContext({
subscriptionType: SubscriptionType.PAYG,
});
const addDatabasePane = explorer.addDatabasePane as AddDatabasePane;
expect(addDatabasePane.getSharedThroughputDefault()).toBe(true);
});