Skip to content

integration of footers and titles to newline counts for pagination #69

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

Merged
merged 1 commit into from
Oct 18, 2023
Merged
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
18 changes: 8 additions & 10 deletions tests/testthat/_snaps/pagination_table.md
Original file line number Diff line number Diff line change
@@ -429,7 +429,7 @@
Code
sapply(pag_res, nrow)
Output
[1] 8 13 14 12 14 16
[1] 8 13 14 12 14 8 8

---

@@ -489,14 +489,6 @@
- Any Grade - 35 (26.1%) 48 (35.8%) 55 (41.7%)
Grade 1-2 35 (26.1%) 48 (35.8%) 55 (41.7%)
2 35 (26.1%) 48 (35.8%) 55 (41.7%)
cl C.1
- Any Grade - 43 (32.1%) 46 (34.3%) 43 (32.6%)
Grade 3-4 43 (32.1%) 46 (34.3%) 43 (32.6%)
4 43 (32.1%) 46 (34.3%) 43 (32.6%)
dcd C.1.1.1.3
- Any Grade - 43 (32.1%) 46 (34.3%) 43 (32.6%)
Grade 3-4 43 (32.1%) 46 (34.3%) 43 (32.6%)
4 43 (32.1%) 46 (34.3%) 43 (32.6%)
——————————————————————————————————————————————————————————————
main footer
@@ -512,7 +504,7 @@
Code
sapply(pag_res, nrow)
Output
[1] 61 16
[1] 55 22

---

@@ -530,6 +522,12 @@
A: Drug X B: Placebo C: Combination
SOME TOPLEFT (N=134) (N=134) (N=132)
——————————————————————————————————————————————————————————————
cl B.1
- Any Grade - 47 (35.1%) 49 (36.6%) 43 (32.6%)
Grade 5 47 (35.1%) 49 (36.6%) 43 (32.6%)
dcd B.1.1.1.1
- Any Grade - 47 (35.1%) 49 (36.6%) 43 (32.6%)
Grade 5 47 (35.1%) 49 (36.6%) 43 (32.6%)
cl C.2
- Any Grade - 35 (26.1%) 48 (35.8%) 55 (41.7%)
Grade 1-2 35 (26.1%) 48 (35.8%) 55 (41.7%)
2 changes: 1 addition & 1 deletion tests/testthat/test-pagination_table.R
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ testthat::test_that("Pagination works also if table is decorated", {
# 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 <- 27 # -3 less because of ref fnotes
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))
2 changes: 1 addition & 1 deletion tests/testthat/test-table_pkct01.R
Original file line number Diff line number Diff line change
@@ -135,6 +135,6 @@ testthat::test_that("Specific PKCT01 features are present", {
testthat::expect_equal(tmp_result, as.character(signif(mean_vals, 3)))

# Pagination works roughly
pag_works <- paginate_table(result, verbose = FALSE, lpp = 20) # only \n in title is out of lpp
pag_works <- paginate_table(result, verbose = FALSE, lpp = 21)
testthat::expect_equal(length(pag_works), 6L)
})