From ac3bbcbb78ca2f8b94bb205e8822a7c74c9c5e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Br=C3=A9ant?= Date: Fri, 8 Jul 2022 16:44:24 +0200 Subject: [PATCH] Update tests --- dev/flat_minimal.Rmd | 2 +- tests/testthat/test-sendconfetti.R | 2 +- tests/testthat/test-useconfetti.R | 25 ------------------------- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/dev/flat_minimal.Rmd b/dev/flat_minimal.Rmd index cdc79ed..92f7938 100644 --- a/dev/flat_minimal.Rmd +++ b/dev/flat_minimal.Rmd @@ -144,8 +144,8 @@ if (interactive()) { ``` ```{r tests-sendConfetti} -library(shinytest2) test_that("sendConfetti works", { + library(shinytest2) expect_true(inherits(sendConfetti, "function")) diff --git a/tests/testthat/test-sendconfetti.R b/tests/testthat/test-sendconfetti.R index 97ec15b..fd5f2bf 100644 --- a/tests/testthat/test-sendconfetti.R +++ b/tests/testthat/test-sendconfetti.R @@ -2,7 +2,7 @@ test_that("sendConfetti works", { library(shinytest2) - + expect_true(inherits(sendConfetti, "function")) app <- shinytest2::AppDriver$new( diff --git a/tests/testthat/test-useconfetti.R b/tests/testthat/test-useconfetti.R index 73af265..3e8c181 100644 --- a/tests/testthat/test-useconfetti.R +++ b/tests/testthat/test-useconfetti.R @@ -7,28 +7,3 @@ test_that("useConfetti works", { expect_equal(dep[["name"]], "canvas-confetti") expect_true(length(dep[["script"]]) > 1) }) - -test_that("sendConfetti works", { - library(shinytest2) - - expect_true(inherits(sendConfetti, "function")) - - app <- shinytest2::AppDriver$new( - system.file("shiny", "test", "app.R", package = "confetti") - ) - expect_equal(app$get_value(input = "go")[[1]], 0) - expect_equal(app$get_value(input = "sentConfetti")[[1]], 0) - - app$click("go") - html <- app$get_html("canvas") - expect_equal( - html, - "" - ) - expect_equal(app$get_value(input = "go")[[1]], 1) - expect_equal(app$get_value(input = "sentConfetti")[[1]], 1) - - app$click("go") - expect_equal(app$get_value(input = "go")[[1]], 2) - expect_equal(app$get_value(input = "sentConfetti")[[1]], 2) -})