mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 06:56:38 +00:00
458cca8e01
Co-authored-by: Steve Faulkner <471400+southpolesteve@users.noreply.github.com>
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import { DatabaseAccount } from "./Contracts/DataModels";
|
|
import { updateUserContext, userContext } from "./UserContext";
|
|
|
|
describe("shouldShowQueryPageOptions()", () => {
|
|
it("should be SQL for Default API", () => {
|
|
updateUserContext({});
|
|
expect(userContext.apiType).toBe("SQL");
|
|
});
|
|
|
|
it("should be Cassandra for EnableCassandra API", () => {
|
|
updateUserContext({
|
|
databaseAccount: {
|
|
properties: {
|
|
capabilities: [{ name: "EnableCassandra" }],
|
|
},
|
|
} as DatabaseAccount,
|
|
});
|
|
expect(userContext.apiType).toBe("Cassandra");
|
|
});
|
|
|
|
it("should be Gremlin for EnableGremlin API", () => {
|
|
updateUserContext({
|
|
databaseAccount: {
|
|
properties: {
|
|
capabilities: [{ name: "EnableGremlin" }],
|
|
},
|
|
} as DatabaseAccount,
|
|
});
|
|
expect(userContext.apiType).toBe("Gremlin");
|
|
});
|
|
|
|
it("should be Tables for EnableTable API", () => {
|
|
updateUserContext({
|
|
databaseAccount: {
|
|
properties: {
|
|
capabilities: [{ name: "EnableTable" }],
|
|
},
|
|
} as DatabaseAccount,
|
|
});
|
|
expect(userContext.apiType).toBe("Tables");
|
|
});
|
|
|
|
it("should be Mongo for MongoDB API", () => {
|
|
updateUserContext({
|
|
databaseAccount: {
|
|
kind: "MongoDB",
|
|
} as DatabaseAccount,
|
|
});
|
|
expect(userContext.apiType).toBe("Mongo");
|
|
});
|
|
|
|
it("should be Mongo for Parse API", () => {
|
|
updateUserContext({
|
|
databaseAccount: {
|
|
kind: "Parse",
|
|
} as DatabaseAccount,
|
|
});
|
|
expect(userContext.apiType).toBe("Mongo");
|
|
});
|
|
});
|