Skip to content

Commit

Permalink
add simple shiny module test
Browse files Browse the repository at this point in the history
  • Loading branch information
bthieurmel committed Oct 25, 2017
1 parent 8ad7e36 commit 14e7691
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/testthat/test-module.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
context("Shiny Module")

describe("Shiny Module", {
it("returns a well defined shiny module", {
c <- manipulateWidget(
paste(a, b),
a = mwSelect(c("a", "b", "c")),
b = mwText("test"),
.compare = "a", .runApp = FALSE
)

# server
f_server <- c$getModuleServer()
expect_is(f_server, "function")
expect_equal(names(formals(f_server)), c("input", "output", "session", "..."))

f_ui <- c$getModuleUI()
expect_is(f_ui, "function")
})
})

0 comments on commit 14e7691

Please sign in to comment.