Skip to content

Commit

Permalink
ci: fix the ci on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurData committed Jul 31, 2024
1 parent 4edccad commit 4b67a05
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 46 deletions.
6 changes: 1 addition & 5 deletions R/sendconfetti.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
#' @examples
#' if (interactive()) {
#' library(shiny)
#'
#' if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
#' testthat::skip()
#' }
#'
#'
#' shinyApp(
#' ui = fluidRow(
#' useConfetti(),
Expand Down
4 changes: 0 additions & 4 deletions R/sendfireworks.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#' @examples
#' if (interactive()) {
#' library(shiny)
#'
#' if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
#' testthat::skip()
#' }
#'
#' shinyApp(
#' ui = fluidRow(
Expand Down
28 changes: 14 additions & 14 deletions dev/flat_minimal.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ sendConfetti <- function(particle_count = 50,
```{r example-sendConfetti}
if (interactive()) {
library(shiny)
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
shinyApp(
ui = fluidRow(
useConfetti(),
Expand All @@ -149,27 +145,31 @@ if (interactive()) {

```{r tests-sendConfetti}
test_that("sendConfetti works", {
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
library(shinytest2)
expect_true(inherits(sendConfetti, "function"))
app <- shinytest2::AppDriver$new(
system.file("shiny", "test", "confetti", "app.R", package = "confetti")
)
expect_equal(app$get_value(input = "go")[[1]], 0)
expect_equal(app$get_value(input = "sentFireworks"), 0)
expect_equal(app$get_value(input = "sentConfetti"), 0)
app$click("go")
html <- app$get_html("canvas")
expect_equal(
html,
html,
"<canvas style=\"position: fixed; top: 0px; left: 0px; pointer-events: none; z-index: 100;\" width=\"992\" height=\"1323\"></canvas>"
)
expect_equal(app$get_value(input = "go")[[1]], 1)
expect_equal(app$get_value(input = "sentConfetti"), 1)
expect_equal(app$get_value(input = "sentFireworks"), 0)
app$click("go")
expect_equal(app$get_value(input = "go")[[1]], 2)
expect_equal(app$get_value(input = "sentConfetti"), 2)
Expand Down Expand Up @@ -215,10 +215,6 @@ sendfireworks <- function(duration,
```{r example-sendfireworks}
if (interactive()) {
library(shiny)
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
shinyApp(
ui = fluidRow(
Expand Down Expand Up @@ -247,6 +243,10 @@ if (interactive()) {
test_that("sendfireworks works", {
library(shinytest2)
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
app <- shinytest2::AppDriver$new(
system.file("shiny", "test", "fireworks", "app.R", package = "confetti")
)
Expand Down
6 changes: 1 addition & 5 deletions man/sendConfetti.Rd

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

4 changes: 0 additions & 4 deletions man/sendfireworks.Rd

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

14 changes: 9 additions & 5 deletions tests/testthat/test-sendconfetti.R
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# WARNING - Generated by {fusen} from dev/flat_minimal.Rmd: do not edit by hand

test_that("sendConfetti works", {
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}

library(shinytest2)

expect_true(inherits(sendConfetti, "function"))

app <- shinytest2::AppDriver$new(
system.file("shiny", "test", "confetti", "app.R", package = "confetti")
)
expect_equal(app$get_value(input = "go")[[1]], 0)
expect_equal(app$get_value(input = "sentFireworks"), 0)
expect_equal(app$get_value(input = "sentConfetti"), 0)

app$click("go")
html <- app$get_html("canvas")
expect_equal(
html,
html,
"<canvas style=\"position: fixed; top: 0px; left: 0px; pointer-events: none; z-index: 100;\" width=\"992\" height=\"1323\"></canvas>"
)
expect_equal(app$get_value(input = "go")[[1]], 1)
expect_equal(app$get_value(input = "sentConfetti"), 1)
expect_equal(app$get_value(input = "sentFireworks"), 0)

app$click("go")
expect_equal(app$get_value(input = "go")[[1]], 2)
expect_equal(app$get_value(input = "sentConfetti"), 2)
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-sendfireworks.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
test_that("sendfireworks works", {
library(shinytest2)

if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}

app <- shinytest2::AppDriver$new(
system.file("shiny", "test", "fireworks", "app.R", package = "confetti")
)
Expand Down
10 changes: 1 addition & 9 deletions vignettes/send-confetti.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ useConfetti()
```{r example-sendConfetti}
if (interactive()) {
library(shiny)
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
shinyApp(
ui = fluidRow(
useConfetti(),
Expand All @@ -69,10 +65,6 @@ if (interactive()) {
```{r example-sendfireworks}
if (interactive()) {
library(shiny)
if (shinytest2:::on_ci() && shinytest2:::is_windows()) {
testthat::skip()
}
shinyApp(
ui = fluidRow(
Expand Down

0 comments on commit 4b67a05

Please sign in to comment.