Skip to content

Commit

Permalink
skip visual tests with R version is not current
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSlPires committed May 22, 2024
1 parent 02d9a4e commit ef76dfc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-geom_daynight.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test for basic usage with default parameters
test_that("Basic usage with default parameters", {
skip_if(getRversion() < 4.4)
p <- ggplot2::ggplot(daynight_temperature, ggplot2::aes(datetime, temperature)) +
geom_daynight() +
ggplot2::geom_point()
Expand All @@ -9,6 +10,7 @@ test_that("Basic usage with default parameters", {

# Test for basic usage with faceting by sensor
test_that("Basic usage with faceting by sensor", {
skip_if(getRversion() < 4.4)
p <- ggplot2::ggplot(daynight_temperature, ggplot2::aes(datetime, temperature)) +
geom_daynight() +
ggplot2::geom_point() +
Expand All @@ -19,6 +21,7 @@ test_that("Basic usage with faceting by sensor", {

# Test for usage with lines and color by sensor
test_that("Usage with lines and color by sensor", {
skip_if(getRversion() < 4.4)
p <- ggplot2::ggplot(daynight_temperature, ggplot2::aes(datetime, temperature, color = sensor)) +
geom_daynight() +
ggplot2::geom_line()
Expand All @@ -28,6 +31,7 @@ test_that("Usage with lines and color by sensor", {

# Test for custom day and night fill colors, custom sunrise and sunset times, and adjusted alpha
test_that("Custom day and night fill colors, custom sunrise and sunset times, and adjusted alpha", {
skip_if(getRversion() < 4.4)
p <- ggplot2::ggplot(daynight_temperature, ggplot2::aes(datetime, temperature, color = sensor)) +
geom_daynight(
day_fill = "yellow", night_fill = "blue",
Expand All @@ -40,6 +44,7 @@ test_that("Custom day and night fill colors, custom sunrise and sunset times, an

# Test for custom day and night fill colors, custom sunrise and sunset times, and adjusted alpha
test_that("Custom day and night fill colors, custom sunrise and sunset times, and adjusted alpha", {
skip_if(getRversion() < 4.4)
p <- ggplot2::ggplot(daynight_temperature, ggplot2::aes(datetime, temperature, color = sensor)) +
geom_daynight(
day_fill = "yellow", night_fill = "blue",
Expand All @@ -52,6 +57,7 @@ test_that("Custom day and night fill colors, custom sunrise and sunset times, an

# Test only daytime plot
test_that("Test only daytime plot", {
skip_if(getRversion() < 4.4)
data <- daynight_temperature[
daynight_temperature$datetime > as.POSIXct("2024-04-23 11:00") &
daynight_temperature$datetime < as.POSIXct("2024-04-23 12:00"),
Expand All @@ -68,6 +74,7 @@ test_that("Test only daytime plot", {

# Test only nighttime plot
test_that("Test only nighttime plot", {
skip_if(getRversion() < 4.4)
data <- daynight_temperature[
daynight_temperature$datetime > as.POSIXct("2024-04-23 19:00") &
daynight_temperature$datetime < as.POSIXct("2024-04-23 20:00"),
Expand Down

0 comments on commit ef76dfc

Please sign in to comment.