const { describe, it, expect } = require("@jest/globals");
const briefcase = require("../index.js");
describe("SimpleDriftCalculator", () => {
it("calculates drift metrics as JSON", () => {
const calc = new briefcase.SimpleDriftCalculator();
const metrics = JSON.parse(calc.calculateDrift(["A", "A", "B"]));
expect(metrics.consensus_output).toBe("A");
expect(metrics.agreement_rate).toBeCloseTo(2 / 3);
expect(metrics.drift_score).toBeGreaterThan(0);
expect(Array.isArray(metrics.outliers)).toBe(true);
});
it("supports threshold constructor and status output", () => {
const calc = briefcase.SimpleDriftCalculator.withThreshold(0.9);
const status = calc.getStatusString(["same", "same", "different"]);
expect(["stable", "drifting", "critical", "highdrift", "high_drift"]).toContain(status);
});
});