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

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