From a6c505eed47a7b3c76ef6356a5d88dbc35ed66b0 Mon Sep 17 00:00:00 2001 From: Jana Spinner <56519375+js3110@users.noreply.github.com> Date: Thu, 2 Jan 2025 08:33:28 +0100 Subject: [PATCH] Update test-generate_col_defs.R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mateusz Kołomański <63905560+m-kolomanski@users.noreply.github.com> --- tests/testthat/test-generate_col_defs.R | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/testthat/test-generate_col_defs.R b/tests/testthat/test-generate_col_defs.R index 1e95c4cc..633bb476 100644 --- a/tests/testthat/test-generate_col_defs.R +++ b/tests/testthat/test-generate_col_defs.R @@ -1,7 +1,7 @@ source(system.file("shiny/functions/generate_col_defs.R", package = "aNCA")) describe("generate_col_defs", { - it("generates column definitions with labels", { + it("generates a list of column definitions with labels", { data <- data.frame( USUBJID = c(1, 2, 3), AVAL = c(4, 5, 6) @@ -9,15 +9,8 @@ describe("generate_col_defs", { attr(data$USUBJID, "label") <- "Unique Subject Identifier" attr(data$AVAL, "label") <- "Analysis Value" col_defs <- generate_col_defs(data) + expect_type(col_defs, "list") expect_equal(col_defs$USUBJID$header$attribs$title, "Unique Subject Identifier") expect_equal(col_defs$AVAL$header$attribs$title, "Analysis Value") }) - it("returns a list of column definitions", { - data <- data.frame( - USUBJID = c(1, 2, 3), - AVAL = c(4, 5, 6) - ) - col_defs <- generate_col_defs(data) - expect_type(col_defs, "list") - }) }) \ No newline at end of file