Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests after count_occurrences refactor #77

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/testthat/test-pagination_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ testthat::test_that("Pagination works also if table is decorated", {
# title (2) + subtitle (3) + empty line (1) + div (1) + header (3) +
# + nrows (x) + ref footnote (3) + footer (1+2 empty lines) + prov footer (4)
testthat::expect_silent(paginate_table(raw_result, lpp = 13))
testthat::expect_error(paginate_table(raw_result, lpp = 12))
testthat::expect_error(suppressMessages(paginate_table(raw_result, lpp = 12)))
# base is: 20 + x [x from paginate_table(raw_result) is min 13 - 3 (header)]
# -> 30
# for pagination with decoration and no wrapping we expect 27
lpp_min <- 28 # -2 less because of ref fnotes
cpp_min <- 72 # 70 is the std now, this table is 72
testthat::expect_silent(paginate_table(res, lpp = lpp_min, cpp = cpp_min))
testthat::expect_error(paginate_table(res, lpp = lpp_min - 1, cpp = cpp_min))
testthat::expect_error(suppressMessages(paginate_table(res, lpp = lpp_min - 1, cpp = cpp_min)))

# for clw above this is 42 (15 more lines due to wrapping)
lpp_min <- 42
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-table_aet03.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ testthat::test_that("AET03 variant 1 is produced correctly", {
# With 8, it works perfectly for the first block but others have much more nesting
lpp_test <- 8
testthat::expect_error(
paginate_table(result, lpp = lpp_test)[[1]]
suppressMessages(paginate_table(result, lpp = lpp_test)[[1]])
)

pag_result <- paginate_table(result, lpp = 16)
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-table_dst01.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ testthat::test_that("DST01 default variant is produced correctly", {
) %>%
count_occurrences(
"EOSSTT",
.stats = "count_fraction",
show_labels = "hidden"
) %>%
analyze_vars(
Expand All @@ -53,7 +52,6 @@ testthat::test_that("DST01 variants 2 and 3 are produced correctly", {
) %>%
count_occurrences(
"EOSSTT",
.stats = "count_fraction",
show_labels = "hidden"
) %>%
split_rows_by("DCSREASGP", indent_mod = 1L) %>%
Expand All @@ -77,7 +75,6 @@ testthat::test_that("DST01 variants 2 and 3 are produced correctly", {
) %>%
count_occurrences(
"EOTSTT",
.stats = "count_fraction",
show_labels = "hidden"
)

Expand Down