diff --git a/frontend/__test_support__/additional_mocks.ts b/frontend/__test_support__/additional_mocks.ts index 60102f0f0..6d80eed8a 100644 --- a/frontend/__test_support__/additional_mocks.ts +++ b/frontend/__test_support__/additional_mocks.ts @@ -5,3 +5,14 @@ jest.mock("browser-speech", () => ({ jest.mock("../open_farm/cached_crop", () => ({ cachedCrop: jest.fn(() => Promise.resolve({ svg_icon: "icon" })), })); + +const { ancestorOrigins } = window.location; +delete window.location; +window.location = { + assign: jest.fn(), + reload: jest.fn(), + replace: jest.fn(), + ancestorOrigins, + pathname: "", href: "", hash: "", search: "", + hostname: "", origin: "", port: "", protocol: "", host: "", +}; diff --git a/frontend/devices/components/farmbot_os_settings.tsx b/frontend/devices/components/farmbot_os_settings.tsx index 3c0f7f6b5..5aaa3cb35 100644 --- a/frontend/devices/components/farmbot_os_settings.tsx +++ b/frontend/devices/components/farmbot_os_settings.tsx @@ -13,7 +13,6 @@ import { BoardType } from "./fbos_settings/board_type"; import { FarmbotOsRow } from "./fbos_settings/farmbot_os_row"; import { AutoUpdateRow } from "./fbos_settings/auto_update_row"; import { AutoSyncRow } from "./fbos_settings/auto_sync_row"; -import { isUndefined } from "lodash"; import { PowerAndReset } from "./fbos_settings/power_and_reset"; import { SendDiagnosticReport } from "./send_diagnostic_report"; import { BootSequenceSelector } from "./fbos_settings/boot_sequence_selector"; @@ -154,11 +153,9 @@ export class FarmbotOsSettings botToMqttLastSeen={new Date(this.props.botToMqttLastSeen).getTime()} timeSettings={this.props.timeSettings} deviceAccount={this.props.deviceAccount} /> - {(location.host.includes("localhost") - || !isUndefined(sourceFbosConfig("auto_sync").value)) && - } + {this.props.shouldDisplay(Feature.boot_sequence) && }