mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
plots new accept pri, sec and ter arguments instead of x,y,z to avoid confusion. tests, tests, tests
This commit is contained in:
parent
e463fa0670
commit
652a8ca1b7
28 changed files with 3275 additions and 179 deletions
|
|
@ -1,3 +1,83 @@
|
|||
test_that("Create columnSelectInput", {
|
||||
expect_snapshot(columnSelectInput("x",label = "X",data = mtcars))
|
||||
library(shiny)
|
||||
ui <- shiny::fluidPage(
|
||||
shiny::uiOutput("x"),
|
||||
shiny::uiOutput("out")
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
library(FreesearchR)
|
||||
output$x <-
|
||||
shiny::renderUI({
|
||||
columnSelectInput(inputId = "x",selected = "mpg",label = "X",data = mtcars)
|
||||
})
|
||||
|
||||
output$out <- renderText({
|
||||
# req(input$x)
|
||||
input$x
|
||||
})
|
||||
}
|
||||
|
||||
# shinyApp(ui,server)
|
||||
|
||||
testServer(server, {
|
||||
session$setInputs(x = "cyl")
|
||||
expect_equal(output$out, "cyl")
|
||||
|
||||
session$setInputs(x = "mpg")
|
||||
expect_equal(output$out, "mpg")
|
||||
})
|
||||
|
||||
server <- function(input, output, session) {
|
||||
library(FreesearchR)
|
||||
output$x <-
|
||||
shiny::renderUI({
|
||||
columnSelectInput(inputId = "x",label = "X",data = gtsummary::trial)
|
||||
})
|
||||
|
||||
output$out <- renderText({
|
||||
# req(input$x)
|
||||
input$x
|
||||
})
|
||||
}
|
||||
|
||||
# shinyApp(ui,server)
|
||||
|
||||
testServer(server, {
|
||||
session$setInputs(x = "trt")
|
||||
expect_equal(output$out, "trt")
|
||||
|
||||
session$setInputs(x = "stage")
|
||||
expect_equal(output$out, "stage")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
test_that("Create columnSelectInput", {
|
||||
library(shiny)
|
||||
ui <- shiny::fluidPage(
|
||||
shiny::uiOutput("x"),
|
||||
shiny::uiOutput("out")
|
||||
)
|
||||
server <- function(input, output, session) {
|
||||
library(FreesearchR)
|
||||
output$x <-
|
||||
shiny::renderUI({
|
||||
vectorSelectInput(inputId = "x",choices = setNames(names(mtcars),seq_len(ncol(mtcars))),label = "X")
|
||||
})
|
||||
|
||||
output$out <- renderText({
|
||||
# req(input$x)
|
||||
input$x
|
||||
})
|
||||
}
|
||||
|
||||
# shinyApp(ui,server)
|
||||
|
||||
testServer(server, {
|
||||
session$setInputs(x = "cyl")
|
||||
expect_equal(output$out, "cyl")
|
||||
|
||||
session$setInputs(x = "mpg")
|
||||
expect_equal(output$out, "mpg")
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue