test_that("standard audits return the five cross-model domains where applicable", {
  dat <- transform(mtcars, transmission = factor(am))
  out <- statwitness(
    mpg ~ transmission + wt + hp,
    data = dat,
    focus = "transmission",
    audit_level = "standard"
  )

  expect_true(all(c("domain", "status") %in% names(out$domains)))
  expect_true(all(c(
    "computational_integrity", "numerical_stability",
    "assumption_screening", "influence_stability"
  ) %in% out$domains$domain))
  expect_true(any(out$tests$id == "fixed_design_condition"))
  expect_true(any(out$tests$id == "case_influence"))
  expect_true(any(out$tests$id == "residual_shape"))
})

test_that("core level omits assumption and influence screens", {
  out <- statwitness(mpg ~ wt + hp, data = mtcars, focus = "wt", audit_level = "core")
  expect_false(any(out$tests$id %in% c("case_influence", "residual_shape", "residual_variance")))
  expect_true(any(out$tests$id == "fixed_design_condition"))
})

test_that("registry exposes domains for every registered test", {
  reg <- witness_registry()
  expect_true(all(nzchar(reg$domain)))
  expect_identical(anyDuplicated(reg$id), 0L)
})
