From e8e6a1180f97b104af58cbca275071f8231c8e29 Mon Sep 17 00:00:00 2001 From: vedhav Date: Tue, 8 Oct 2024 19:06:05 +0530 Subject: [PATCH] chore: add a test to check if FilterData object is created for limited datasets --- tests/testthat/test-utils.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 4904c46461..eca92b3265 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -45,6 +45,20 @@ test_that("teal_data_to_filtered_data return FilteredData class", { testthat::expect_s3_class(teal_data_to_filtered_data(teal_data), "FilteredData") }) +testthat("teal_data_to_filtered_data creates FilterData class with datanames that are passed", { + teal_data <- within( + teal.data::teal_data(), + { + iris <- head(iris) + mtcars <- head(mtcars) + } + ) + teal.data::datanames(teal_data) <- "iris" + + fd <- teal_data_to_filtered_data(teal_data) + testthat::expect_equal(fd$datanames(), "iris") +}) + test_that("validate_app_title_tag works on validating the title tag", { valid_title <- tags$head( tags$title("title"),