Skip to content

Commit d8319e8

Browse files
authored
Merge pull request #100 from Merck/DEVR-3587_fix_issue87_format_ae_forestly
Tested the fix done by Nan of the issue #87 regarding n & pct display…
2 parents 50465b3 + bec243d commit d8319e8

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/testthat/test-format_ae_forestly.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@ test_that("Set `display` to ('n', 'prop', 'total') then one has total column", {
4646
expect_false("total" %in% names(ae_frm))
4747
})
4848

49+
test_that("Set `display` to ('diff', 'total') without ('n', 'prop') columns", {
50+
out <- test_format_ae_forestly()
51+
ae_frm <- format_ae_forestly(
52+
out,
53+
display = c("diff", "total"),
54+
digits = 1,
55+
width_term = 200,
56+
width_fig = 300,
57+
width_n = 40,
58+
width_prop = 60,
59+
width_diff = 80,
60+
footer_space = 90,
61+
color = NULL,
62+
diff_label = "Treatment <- Favor -> Placebo",
63+
show_ae_parameter = FALSE
64+
)
65+
66+
# expect_named(ae_frm, c("n", "prop", "total"))
67+
expect_named(ae_frm)
68+
expect_true("diff" %in% ae_frm$display[1])
69+
expect_true("total" %in% ae_frm$display[2])
70+
})
71+
4972
test_that("1. Set `display` to ('n', 'prop', 'total', 'diff') and change column width using argument
5073
2. Change `diff_label` to 'MK-xxxx <- Favor -> Placebo' and 'footer_space' to change location of footer", {
5174
out <- test_format_ae_forestly()

0 commit comments

Comments
 (0)