first
This commit is contained in:
56
tests/basic.test.js
Normal file
56
tests/basic.test.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* @fileoverview Basic test to verify Jest setup
|
||||
*/
|
||||
|
||||
import { describe, test, expect } from "@jest/globals";
|
||||
|
||||
describe("Basic Test Setup", () => {
|
||||
test("should verify Jest is working", () => {
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
|
||||
test("should have test constants available", () => {
|
||||
expect(global.testConstants).toBeDefined();
|
||||
expect(global.testConstants.AUTH_TYPES).toBeDefined();
|
||||
expect(global.testConstants.AUTH_TYPES.PROVIDER).toBe("provider");
|
||||
});
|
||||
|
||||
test("should have test utilities available", () => {
|
||||
expect(global.testUtils).toBeDefined();
|
||||
expect(typeof global.testUtils.generateRandomString).toBe("function");
|
||||
expect(typeof global.testUtils.generateRandomEmail).toBe("function");
|
||||
});
|
||||
|
||||
test("should have healthcare constants available", () => {
|
||||
expect(global.healthcareConstants).toBeDefined();
|
||||
expect(global.healthcareConstants.VALID_ICD10_CODES).toBeDefined();
|
||||
expect(Array.isArray(global.healthcareConstants.VALID_ICD10_CODES)).toBe(
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
test("should have custom matchers available", () => {
|
||||
const hipaaData = {
|
||||
hipaaMetadata: {
|
||||
dataClassification: "PHI",
|
||||
encryptionStatus: "encrypted",
|
||||
},
|
||||
};
|
||||
|
||||
expect(hipaaData).toBeHIPAACompliant();
|
||||
});
|
||||
|
||||
test("should have mock data creation functions", () => {
|
||||
expect(typeof global.testUtils.createMockPatientData).toBe("function");
|
||||
expect(typeof global.testUtils.createMockProviderData).toBe("function");
|
||||
expect(typeof global.testUtils.createMockAppointmentData).toBe("function");
|
||||
expect(typeof global.testUtils.createMockPrescriptionData).toBe("function");
|
||||
|
||||
// Test that mock functions actually work
|
||||
const mockPatient = global.testUtils.createMockPatientData();
|
||||
expect(mockPatient).toBeDefined();
|
||||
expect(mockPatient.id).toMatch(/^patient_/);
|
||||
expect(mockPatient.hipaaMetadata).toBeDefined();
|
||||
expect(mockPatient.auditTrail).toBeDefined();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user