mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 12:37:30 +02:00
data type icons in summary - more tests
This commit is contained in:
parent
652a8ca1b7
commit
50d35c0c85
15 changed files with 406 additions and 2493 deletions
|
|
@ -3,44 +3,26 @@
|
|||
|
||||
test_that("Creates correct table",{
|
||||
## This is by far the easiest way to test all functions. Based on examples.
|
||||
expect_snapshot(create_baseline(mtcars,by.var = "gear", add.p = "yes" == "yes",add.overall = TRUE, theme = "lancet"))
|
||||
expect_snapshot(create_baseline(mtcars,by.var = "none", add.p = FALSE,add.overall = FALSE, theme = "lancet"))
|
||||
expect_snapshot(create_baseline(mtcars,by.var = "test", add.p = FALSE,add.overall = FALSE, theme = "jama"))
|
||||
expect_snapshot(create_baseline(default_parsing(mtcars),by.var = "am", add.p = FALSE,add.overall = FALSE, theme = "nejm"))
|
||||
})
|
||||
tbl <- create_baseline(mtcars,by.var = "gear", add.p = "yes" == "yes",add.overall = TRUE, theme = "lancet")
|
||||
|
||||
test_that("Creates table", {
|
||||
tbl <- mtcars |> baseline_table(fun.args = list(by = "gear"))
|
||||
|
||||
expect_equal(length(tbl), 5)
|
||||
|
||||
expect_equal(NROW(tbl$table_body), 19)
|
||||
|
||||
expect_equal(NCOL(tbl$table_body), 8)
|
||||
|
||||
expect_equal(names(tbl), c("table_body", "table_styling", "call_list", "cards", "inputs"))
|
||||
})
|
||||
|
||||
test_that("Creates table", {
|
||||
tbl <- mtcars |> create_baseline(by.var = "gear", add.p = "yes" == "yes")
|
||||
|
||||
expect_equal(length(tbl), 5)
|
||||
expect_equal(length(tbl),5)
|
||||
|
||||
expect_equal(NROW(tbl$table_body), 19)
|
||||
|
||||
expect_equal(NCOL(tbl$table_body), 13)
|
||||
|
||||
tbl$call_list
|
||||
expect_equal(names(tbl), c("table_body", "table_styling", "call_list", "cards", "inputs"))
|
||||
|
||||
tbl <- create_baseline(mtcars,by.var = "none", add.p = FALSE,add.overall = FALSE, theme = "lancet")
|
||||
|
||||
expect_equal(length(tbl),5)
|
||||
|
||||
tbl <- create_baseline(mtcars,by.var = "test", add.p = FALSE,add.overall = FALSE, theme = "jama")
|
||||
|
||||
expect_equal(length(tbl),5)
|
||||
|
||||
tbl <- create_baseline(default_parsing(mtcars),by.var = "am", add.p = FALSE,add.overall = FALSE, theme = "nejm")
|
||||
|
||||
expect_equal(length(tbl),5)
|
||||
})
|
||||
|
||||
test_that("Creates table", {
|
||||
tbl <- mtcars |> create_baseline(by.var = "gear", add.p = "yes" == "yes")
|
||||
|
||||
expect_equal(length(tbl), 5)
|
||||
|
||||
expect_equal(NROW(tbl$table_body), 19)
|
||||
|
||||
expect_equal(NCOL(tbl$table_body), 13)
|
||||
|
||||
expect_equal(names(tbl), c("table_body", "table_styling", "call_list", "cards", "inputs"))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue