mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-25 03:41:19 +00:00
* Fixed Sample Data logic and remove notifications references * fixed undefined * fixed unit tests * fixed format test * cleanup --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { PortalBackendEndpoints } from "Common/Constants";
|
|
import { updateConfigContext } from "ConfigContext";
|
|
import * as EnvironmentUtility from "./EnvironmentUtility";
|
|
|
|
describe("Environment Utility Test", () => {
|
|
it("Test sample URI with /", () => {
|
|
const uri = "test/";
|
|
expect(EnvironmentUtility.normalizeArmEndpoint(uri)).toEqual(uri);
|
|
});
|
|
|
|
it("Test sample URI without /", () => {
|
|
const uri = "test";
|
|
const expectedResult = "test/";
|
|
expect(EnvironmentUtility.normalizeArmEndpoint(uri)).toEqual(expectedResult);
|
|
});
|
|
|
|
it("Detect environment is Mpac", () => {
|
|
updateConfigContext({
|
|
PORTAL_BACKEND_ENDPOINT: PortalBackendEndpoints.Mpac,
|
|
});
|
|
expect(EnvironmentUtility.getEnvironment()).toBe(EnvironmentUtility.Environment.Mpac);
|
|
});
|
|
|
|
it("Detect environment is Development", () => {
|
|
updateConfigContext({
|
|
PORTAL_BACKEND_ENDPOINT: PortalBackendEndpoints.Development,
|
|
});
|
|
expect(EnvironmentUtility.getEnvironment()).toBe(EnvironmentUtility.Environment.Development);
|
|
});
|
|
});
|