/**
 * SET 49 — boot check must reject AdminView-as-app and require control panel.
 */
import { describe, expect, it } from 'vitest';
import {
  checkWebBootSource,
  checkWebBootBundle,
} from '../scripts/check-web-boot';

describe('SET 49 web boot check', () => {
  it('source invariants: control markers + admin gated + boot defaults false', () => {
    const r = checkWebBootSource();
    expect(r.ok, r.detail).toBe(true);
  });

  it('bundle check fails clearly when dist missing markers (or passes when built)', () => {
    const r = checkWebBootBundle();
    // Dist may be stale/absent in unit CI — only assert shape of result.
    expect(typeof r.ok).toBe('boolean');
    expect(r.detail.length).toBeGreaterThan(0);
    if (r.ok) {
      expect(r.detail).toMatch(/bundle markers/);
    } else {
      expect(r.detail).toMatch(/missing|marker|Compile|dist/i);
    }
  });
});
