test_that("GSBPM 5.2 mapping contains core official-statistics quality activities", { x <- gsbpm52_map() expect_true(all(c("6.2", "6.5", "7.5", "8.1", "8.2", "QM", "MM") %in% x$id)) expect_identical(attr(x, "gsbpm_version"), "5.2") expect_true(any(x$id == "6.2" & x$relationship == "direct")) }) test_that("components and functions map to GSBPM 5.2", { s <- gsbpm_align("semantic") expect_true("6.2" %in% s$id) expect_true("QM" %in% s$id) a <- gsbpm_align("audit_stat_ai") expect_true(all(c("6.2", "6.5", "QM", "MM") %in% a$id)) }) test_that("GSBPM quality report preserves audit decision", { ref <- stat_reference( indicator = "Unemployment rate", value = 5.2, unit = "percent", time = "2025", geo = "Exampleland", source = "Official source" ) clm <- stat_claim( indicator = "Unemployment rate", value = 5.2, unit = "percent", time = "2025", geo = "Exampleland", source = "Official source" ) aud <- audit_stat_ai(ref, clm) expect_identical(aud$gsbpm$version, "5.2") expect_true(all(c("6.2", "6.5", "QM", "MM") %in% aud$gsbpm$primary_activities)) rep <- gsbpm_quality_report(aud) expect_s3_class(rep, "stat_gsbpm_report") expect_identical(rep$certification, aud$certification) expect_equal(nrow(rep$components), 10L) expect_true(any(rep$activities$id == "6.2")) })