mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-03 14:46:43 +00:00
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import * as HeadersUtility from "./HeadersUtility";
|
|
import { ExplorerSettings } from "../Shared/ExplorerSettings";
|
|
import { LocalStorageUtility, StorageKey } from "../Shared/StorageUtility";
|
|
|
|
describe("Headers Utility", () => {
|
|
describe("shouldEnableCrossPartitionKeyForResourceWithPartitionKey()", () => {
|
|
beforeEach(() => {
|
|
ExplorerSettings.createDefaultSettings();
|
|
});
|
|
|
|
it("should return true by default", () => {
|
|
expect(HeadersUtility.shouldEnableCrossPartitionKey()).toBe(true);
|
|
});
|
|
|
|
it("should return false if the enable cross partition key feed option is false", () => {
|
|
LocalStorageUtility.setEntryString(StorageKey.IsCrossPartitionQueryEnabled, "false");
|
|
expect(HeadersUtility.shouldEnableCrossPartitionKey()).toBe(false);
|
|
});
|
|
|
|
it("should return true if the enable cross partition key feed option is true", () => {
|
|
LocalStorageUtility.setEntryString(StorageKey.IsCrossPartitionQueryEnabled, "true");
|
|
expect(HeadersUtility.shouldEnableCrossPartitionKey()).toBe(true);
|
|
});
|
|
});
|
|
});
|