Remove Explorer.isEmulator (#256)

This commit is contained in:
Steve Faulkner
2020-10-09 11:18:50 -05:00
committed by GitHub
parent 5191ae3f3a
commit 14cdf19efb
26 changed files with 47 additions and 63 deletions

View File

@@ -104,8 +104,7 @@ describe("SettingsComponent", () => {
expect(settingsComponentInstance.shouldShowKeyspaceSharedThroughputMessage()).toEqual(false);
const newContainer = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
newContainer.isPreferredApiCassandra = ko.computed(() => true);
@@ -148,8 +147,7 @@ describe("SettingsComponent", () => {
expect(settingsComponentInstance.hasConflictResolution()).toEqual(undefined);
const newContainer = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
newContainer.databaseAccount = ko.observable({
id: undefined,

View File

@@ -13,8 +13,7 @@ import ko from "knockout";
describe("ScaleComponent", () => {
const nonNationalCloudContainer = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
nonNationalCloudContainer.getPlatformType = () => PlatformType.Portal;
nonNationalCloudContainer.isRunningOnNationalCloud = () => false;
@@ -89,8 +88,7 @@ describe("ScaleComponent", () => {
it("autoScale enabled", () => {
const newContainer = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
newContainer.databaseAccount({

View File

@@ -19,6 +19,7 @@ import {
import { getMaxRUs, getMinRUs, hasDatabaseSharedThroughput } from "../SettingsUtils";
import * as AutoPilotUtils from "../../../../Utils/AutoPilotUtils";
import { Text, TextField, Stack, Label, MessageBar, MessageBarType } from "office-ui-fabric-react";
import { configContext, Platform } from "../../../../ConfigContext";
export interface ScaleComponentProps {
collection: ViewModels.Collection;
@@ -43,7 +44,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
private isEmulator: boolean;
constructor(props: ScaleComponentProps) {
super(props);
this.isEmulator = this.props.container.isEmulator;
this.isEmulator = configContext.platform === Platform.Emulator;
}
public isAutoScaleEnabled = (): boolean => {

View File

@@ -106,8 +106,7 @@ describe("SubSettingsComponent", () => {
it("partitionKey not visible", () => {
const newContainer = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
newContainer.isPreferredApiCassandra = ko.computed(() => true);

View File

@@ -4,8 +4,7 @@ import Explorer from "../../Explorer";
import ko from "knockout";
export const container = new Explorer({
notificationsClient: undefined,
isEmulator: false
notificationsClient: undefined
});
export const collection = ({

View File

@@ -982,7 +982,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function],
@@ -2296,7 +2295,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function],
@@ -3623,7 +3621,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function],
@@ -4937,7 +4934,6 @@ exports[`SettingsComponent renders 1`] = `
"isAuthWithResourceToken": [Function],
"isCodeOfConductEnabled": [Function],
"isCopyNotebookPaneEnabled": [Function],
"isEmulator": false,
"isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function],
"isGalleryPublishEnabled": [Function],