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

extend TealAppDriver$active_module_element() method with new hash parameter #1150

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d93a8c9
Empty-Commit
m7pr Mar 13, 2024
96f8027
tests for teal.widgets::verbatim_popup
m7pr Mar 13, 2024
e86175e
add info about a detected issue
m7pr Mar 13, 2024
50e0ba3
skeleton for table_with_settings shinytest2 tests
m7pr Mar 13, 2024
ba4959c
wip - testing buttons
m7pr Mar 15, 2024
679ae26
test reviewing buttons of the table
m7pr Mar 15, 2024
c94490f
use $active_module_element instead of print
m7pr Mar 15, 2024
3414184
typo
m7pr Mar 15, 2024
c0cb560
add button clicks
m7pr Mar 15, 2024
6e168f9
change test name for table_with_settings
m7pr Mar 15, 2024
8d0cfd2
Merge branch 'main' into teal.widgets@503-introduce-shinytest2@main
m7pr Mar 21, 2024
d8407df
include features from other PRs
m7pr Mar 21, 2024
4cc61a6
finalize tests for teal.widgets::table_with_settings
m7pr Mar 21, 2024
cd25ffb
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 21, 2024
f4c7557
Merge branch 'main' into teal.widgets@503-introduce-shinytest2@main
m7pr Mar 22, 2024
1cb56fd
Update tests/testthat/test-shinytest2-teal-widgets.R
m7pr Mar 22, 2024
ff4b223
remove comments
m7pr Mar 22, 2024
f002f46
reduce pagination selector
m7pr Mar 22, 2024
9f09704
extract input value for the download button
m7pr Mar 22, 2024
c98585d
[skip style] [skip vbump] Restyle files
github-actions[bot] Mar 22, 2024
bece513
checking the visibility. ugh
m7pr Mar 22, 2024
028dafb
Merge branch 'teal.widgets@503-introduce-shinytest2@main' of https://…
m7pr Mar 22, 2024
ee7e898
Merge branch 'main' into teal.widgets@503-introduce-shinytest2@main
m7pr Apr 2, 2024
9a23c3c
move test to teal.widgets repository
m7pr Apr 8, 2024
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
9 changes: 6 additions & 3 deletions R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,15 @@ TealAppDriver <- R6::R6Class( # nolint: object_name.
#' @description
#' Get the active shiny name space bound with a custom `element` name.
#'
#' @param element `character(1)` custom element name.
#' @param element (`character(1)`) custom element name.
#' @param hash (`logical(1)`) whether to prepend the name with `#` sign.
#'
#' @return (`string`) The active shiny name space of the component bound with the input `element`.
active_module_element = function(element) {
active_module_element = function(element, hash = TRUE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide use case where id is needed without a # prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the app$get_value() that doesn't take #

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but teal.widgets don't use tealAppDriver so I think it isn't necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I've never experience a need to remove hash anywhere else in any other test

checkmate::assert_string(element)
sprintf("#%s-%s", self$active_module_ns(), element)
checkmate::assert_flag(hash)
fmt <- if (hash) "#%s-%s" else "%s-%s"
sprintf(fmt, self$active_module_ns(), element)
},
#' @description
#' Get the text of the active shiny name space bound with a custom `element` name.
Expand Down
6 changes: 4 additions & 2 deletions man/TealAppDriver.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading