mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-27 21:01:57 +00:00
* Default to new backend endpoint if the endpoint in current context does not match existing set in constants. * Remove some env references. * Added comments with reasoning for selecting new backend by default. * Update comment. * Remove all references to useNewPortalBackendEndpoint now that old backend is disabled in all environments. * Resolve lint issues. * Removed references to old backend from Cassandra and Mongo Apis * fix unit tests --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { Platform, resetConfigContext, updateConfigContext } from "../../../ConfigContext";
|
|
import { updateUserContext, userContext } from "../../../UserContext";
|
|
import { getMongoShellUrl } from "./getMongoShellUrl";
|
|
|
|
describe("getMongoShellUrl", () => {
|
|
let queryString = "";
|
|
|
|
beforeEach(() => {
|
|
resetConfigContext();
|
|
|
|
updateConfigContext({
|
|
platform: Platform.Hosted,
|
|
});
|
|
|
|
updateUserContext({
|
|
subscriptionId: "fakeSubscriptionId",
|
|
resourceGroup: "fakeResourceGroup",
|
|
databaseAccount: {
|
|
id: "fakeId",
|
|
name: "fakeName",
|
|
location: "fakeLocation",
|
|
type: "fakeType",
|
|
kind: "fakeKind",
|
|
properties: {
|
|
documentEndpoint: "fakeDocumentEndpoint",
|
|
tableEndpoint: "fakeTableEndpoint",
|
|
gremlinEndpoint: "fakeGremlinEndpoint",
|
|
cassandraEndpoint: "fakeCassandraEndpoint",
|
|
},
|
|
},
|
|
portalEnv: "prod",
|
|
});
|
|
|
|
queryString = `resourceId=${userContext.databaseAccount.id}&accountName=${userContext.databaseAccount.name}&mongoEndpoint=${userContext.databaseAccount.properties.documentEndpoint}`;
|
|
});
|
|
|
|
it("should return /index.html by default", () => {
|
|
expect(getMongoShellUrl().toString()).toContain(`/index.html?${queryString}`);
|
|
});
|
|
});
|