update tests

This commit is contained in:
Asier Isayas 2025-01-24 17:51:48 -05:00
parent 314959985b
commit bda9ae9977
2 changed files with 27 additions and 19 deletions

View File

@ -101,7 +101,7 @@ export enum WorkloadType {
Learning = "Learning", Learning = "Learning",
DevelopmentTesting = "Development/Testing", DevelopmentTesting = "Development/Testing",
Production = "Production", Production = "Production",
None = "None" None = "None",
} }
// flight names returned from the portal are always lowercase // flight names returned from the portal are always lowercase
export class Flights { export class Flights {

View File

@ -5,14 +5,22 @@ import { updateUserContext } from "UserContext";
describe("Database Account Utility", () => { describe("Database Account Utility", () => {
describe("Workload Type", () => { describe("Workload Type", () => {
beforeEach(() => {
updateUserContext({
databaseAccount: {
tags: {} as Tags,
} as DatabaseAccount,
});
});
it("Workload Type should return Learning", () => { it("Workload Type should return Learning", () => {
updateUserContext({ updateUserContext({
databaseAccount: { databaseAccount: {
tags: { tags: {
"hidden-workload-type": WorkloadType.Learning "hidden-workload-type": WorkloadType.Learning,
} as Tags } as Tags,
} as DatabaseAccount } as DatabaseAccount,
}) });
const workloadType: WorkloadType = getWorkloadType(); const workloadType: WorkloadType = getWorkloadType();
expect(workloadType).toBe(WorkloadType.Learning); expect(workloadType).toBe(WorkloadType.Learning);
@ -22,5 +30,5 @@ describe("Database Account Utility", () => {
const workloadType: WorkloadType = getWorkloadType(); const workloadType: WorkloadType = getWorkloadType();
expect(workloadType).toBe(WorkloadType.None); expect(workloadType).toBe(WorkloadType.None);
}); });
}) });
}) });