mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-04 16:51:19 +00:00
Migrated Hosted Explorer to React (#360)
Co-authored-by: Victor Meng <vimeng@microsoft.com> Co-authored-by: Steve Faulkner <stfaul@microsoft.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { AccessInputMetadata } from "../../Contracts/DataModels";
|
||||
import { HostedUtils } from "./HostedUtils";
|
||||
import { getDatabaseAccountPropertiesFromMetadata } from "./HostedUtils";
|
||||
|
||||
describe("getDatabaseAccountPropertiesFromMetadata", () => {
|
||||
it("should only return an object with the mongoEndpoint key if the apiKind is mongoCompute (5)", () => {
|
||||
let mongoComputeAccount: AccessInputMetadata = {
|
||||
const mongoComputeAccount: AccessInputMetadata = {
|
||||
accountName: "compute-batch2",
|
||||
apiEndpoint: "compute-batch2.mongo.cosmos.azure.com:10255",
|
||||
apiKind: 5,
|
||||
@@ -11,21 +11,21 @@ describe("getDatabaseAccountPropertiesFromMetadata", () => {
|
||||
expiryTimestamp: "1234",
|
||||
mongoEndpoint: "https://compute-batch2.mongo.cosmos.azure.com:443/"
|
||||
};
|
||||
expect(HostedUtils.getDatabaseAccountPropertiesFromMetadata(mongoComputeAccount)).toEqual({
|
||||
expect(getDatabaseAccountPropertiesFromMetadata(mongoComputeAccount)).toEqual({
|
||||
mongoEndpoint: mongoComputeAccount.mongoEndpoint,
|
||||
documentEndpoint: mongoComputeAccount.documentEndpoint
|
||||
});
|
||||
});
|
||||
|
||||
it("should not return an object with the mongoEndpoint key if the apiKind is mongo (1)", () => {
|
||||
let mongoAccount: AccessInputMetadata = {
|
||||
const mongoAccount: AccessInputMetadata = {
|
||||
accountName: "compute-batch2",
|
||||
apiEndpoint: "compute-batch2.mongo.cosmos.azure.com:10255",
|
||||
apiKind: 1,
|
||||
documentEndpoint: "https://compute-batch2.documents.azure.com:443/",
|
||||
expiryTimestamp: "1234"
|
||||
};
|
||||
expect(HostedUtils.getDatabaseAccountPropertiesFromMetadata(mongoAccount)).toEqual({
|
||||
expect(getDatabaseAccountPropertiesFromMetadata(mongoAccount)).toEqual({
|
||||
documentEndpoint: mongoAccount.documentEndpoint
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user