/**
 * `clean_error` のコード表の期待値表（指示書U 段階1-2。表示ラベルは 2026-10-19 に削除 — 下の段落）。
 *
 * ★このテストの目的は「後から読みやすく書き換えられるのを止めること」★ —
 *   ラベルは定義書
 *   `docs/handoff/analysis/table-definitions-02-clean-error.md:213` の**原文**であり、
 *   当方が作った文言ではない（D-077 の思想）。★原文が正であることをここで宣言しておく★
 *   （`CLAUDE.md` §6-2）。
 *
 * ★表示ラベル（旧 `CLEAN_ERROR_LABELS` / `cleanErrorLabel()`）は 2026-10-19 に削除した★（本番で未使用。指示書BB A14）。
 *   コード値（`CLEAN_ERROR`）はシード（`scripts/seed-local-db.ts`）が使うので残し、ここで固定する。
 */
import { describe, expect, it } from "vitest";
import { CLEAN_ERROR } from "@/lib/config";

describe("CLEAN_ERROR", () => {
  // 定義書 :213 の原文: 0: 正常, 1: 異常(清掃未実施), 2: 異常(セキュリティ有効),
  //                     3: 異常(D-S制御盤異常), 4: 異常(清掃ロボット異常)
  it("コード値が定義書の原文と一致する", () => {
    expect(CLEAN_ERROR.normal).toBe(0);
    expect(CLEAN_ERROR.notExecuted).toBe(1);
    expect(CLEAN_ERROR.securityEnabled).toBe(2);
    expect(CLEAN_ERROR.controlBoardError).toBe(3);
    expect(CLEAN_ERROR.robotError).toBe(4);
  });

  it("★出発失敗（未実施）を表すのは 1 だけ★（ユーザー回答 2026-09-10）", () => {
    // 2/3/4 は「未実施とは違う扱い」なので、notExecuted と同値になってはいけない
    expect(CLEAN_ERROR.securityEnabled).not.toBe(CLEAN_ERROR.notExecuted);
    expect(CLEAN_ERROR.controlBoardError).not.toBe(CLEAN_ERROR.notExecuted);
    expect(CLEAN_ERROR.robotError).not.toBe(CLEAN_ERROR.notExecuted);
  });
});
