mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-27 21:01:57 +00:00
23 lines
776 B
TypeScript
23 lines
776 B
TypeScript
import { extractFeatures } from "./extractFeatures";
|
|
|
|
describe("extractFeatures", () => {
|
|
it("correctly detects feature flags in a case insensitive manner", () => {
|
|
const url = "https://localhost:10001/12345/notebook";
|
|
const token = "super secret";
|
|
const notebooksEnabled = false;
|
|
const params = new URLSearchParams({
|
|
platform: "Hosted",
|
|
"feature.NOTEBOOKSERVERURL": url,
|
|
"feature.NoTeBooKServerToken": token,
|
|
"feature.NotAFeature": "nope",
|
|
"feature.ENABLEnotebooks": notebooksEnabled.toString(),
|
|
});
|
|
|
|
const features = extractFeatures(params);
|
|
|
|
expect(features.notebookServerUrl).toBe(url);
|
|
expect(features.notebookServerToken).toBe(token);
|
|
expect(features.enableNotebooks).toBe(notebooksEnabled);
|
|
});
|
|
});
|