From a8ea1bcaaf95cd9dae23797c005849ef78b995af Mon Sep 17 00:00:00 2001 From: m7pr Date: Tue, 19 Mar 2024 14:39:43 +0100 Subject: [PATCH] active_module_element_text method --- R/TealAppDriver.R | 10 ++++++++++ man/TealAppDriver.Rd | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/R/TealAppDriver.R b/R/TealAppDriver.R index 2f46b66889..19da883872 100644 --- a/R/TealAppDriver.R +++ b/R/TealAppDriver.R @@ -147,6 +147,16 @@ TealAppDriver <- R6::R6Class( # nolint: object_name. sprintf("#%s-%s", self$active_module_ns(), element) }, #' @description + #' Get the text of the active shiny name space bound with a custom `element` name. + #' + #' @param element `character(1)` the text of the custom element name. + #' + #' @return (`string`) The text of the active shiny name space of the component bound with the input `element`. + active_module_element_text = function(element) { + checkmate::assert_string(element) + self$get_text(self$active_module_element(element)) + }, + #' @description #' Get the active shiny name space for interacting with the filter panel. #' #' @return (`string`) The active shiny name space of the component. diff --git a/man/TealAppDriver.Rd b/man/TealAppDriver.Rd index 17c1c63059..eef87a8e12 100644 --- a/man/TealAppDriver.Rd +++ b/man/TealAppDriver.Rd @@ -28,6 +28,7 @@ driving a teal application for performing interactions for \code{shinytest2} tes \item \href{#method-TealAppDriver-active_ns}{\code{TealAppDriver$active_ns()}} \item \href{#method-TealAppDriver-active_module_ns}{\code{TealAppDriver$active_module_ns()}} \item \href{#method-TealAppDriver-active_module_element}{\code{TealAppDriver$active_module_element()}} +\item \href{#method-TealAppDriver-active_module_element_text}{\code{TealAppDriver$active_module_element_text()}} \item \href{#method-TealAppDriver-active_filters_ns}{\code{TealAppDriver$active_filters_ns()}} \item \href{#method-TealAppDriver-get_active_module_input}{\code{TealAppDriver$get_active_module_input()}} \item \href{#method-TealAppDriver-get_active_module_output}{\code{TealAppDriver$get_active_module_output()}} @@ -239,6 +240,26 @@ Get the active shiny name space bound with a custom \code{element} name. } } \if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-TealAppDriver-active_module_element_text}{}}} +\subsection{Method \code{active_module_element_text()}}{ +Get the text of the active shiny name space bound with a custom \code{element} name. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{TealAppDriver$active_module_element_text(element)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{element}}{\code{character(1)} the text of the custom element name.} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +(\code{string}) The text of the active shiny name space of the component bound with the input \code{element}. +} +} +\if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-TealAppDriver-active_filters_ns}{}}} \subsection{Method \code{active_filters_ns()}}{