Skip to content
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
1 change: 1 addition & 0 deletions R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
)
active_base_id <- sub("-wrapper$", "", active_wrapper_id)

private$ns$base_id <- active_base_id
private$ns$wrapper <- shiny::NS(active_base_id, "wrapper")
private$ns$module <- shiny::NS(active_base_id, "module")
private$ns$filter_panel <- shiny::NS(active_base_id, "filter_panel")
Expand Down
Binary file modified tests/testthat/_snaps/linux-4.5/shinytest2-init/teal-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/testthat/test-shinytest2-reporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ testthat::test_that("e2e: adding a report card in a module adds it in the report
)

# Add new card with label and comment
app$click(app$namespaces()$module_container("add_reporter_wrapper-reporter_add-add_report_card_button"))
app$click(app$namespaces()$base_id("add_reporter_wrapper-reporter_add-add_report_card_button"))

app$set_input(
app$namespaces()$module_container("add_reporter_wrapper-reporter_add-label"),
app$namespaces()$base_id("add_reporter_wrapper-reporter_add-label"),
"Card name"
)
app$click(app$namespaces()$module_container("add_reporter_wrapper-reporter_add-add_card_ok"))
app$click(app$namespaces()$base_id("add_reporter_wrapper-reporter_add-add_card_ok"))

# Check whether card was added
app$run_js("document.querySelector('#teal-preview_report-preview_button').click();") # skipping menu hovering
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-shinytest2-show-rcode.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ testthat::test_that("e2e: Module with 'Show R Code' initializes with visible but

# Check if button exists.
testthat::expect_identical(
app$get_text(app$namespaces(TRUE)$module_container("source_code_wrapper-source_code-button")),
app$get_text(app$namespaces(TRUE)$base_id("source_code_wrapper-source_code-button")),
"Show R code"
)
app$stop()
Expand All @@ -27,7 +27,7 @@ testthat::test_that("e2e: Module with 'Show R Code' has modal with two dismiss a
)
)

app$click(selector = app$namespaces(TRUE)$module_container("source_code_wrapper-source_code-button"))
app$click(selector = app$namespaces(TRUE)$base_id("source_code_wrapper-source_code-button"))

# Check header and title content.
testthat::expect_equal(
Expand All @@ -49,12 +49,12 @@ testthat::test_that("e2e: Module with 'Show R Code' has code", {
)
)

app$click(selector = app$namespaces(TRUE)$module_container("source_code_wrapper-source_code-button"))
app$click(selector = app$namespaces(TRUE)$base_id("source_code_wrapper-source_code-button"))

# Check R code output.
testthat::expect_identical(
strsplit(
app$get_text(app$namespaces(TRUE)$module_container("source_code_wrapper-source_code-verbatim_content")),
app$get_text(app$namespaces(TRUE)$base_id("source_code_wrapper-source_code-verbatim_content")),
"\n"
)[[1]],
c(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-teal_reporter.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
testthat::test_that("TealReportCard object can be initialized", {
testthat::expect_warning(TealReportCard$new(), "was deprecated in teal.reporter")
lifecycle::expect_deprecated(TealReportCard$new())
})

testthat::test_that("TealReportCard inherits from ReportCard", {
Expand Down
Loading