From 314cd553ccbdb2e275755af77b65952e5c01aacf Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Wed, 11 Jun 2025 15:35:13 +0200 Subject: [PATCH] fix test --- tests/testthat/test_kmeans_viz.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test_kmeans_viz.R b/tests/testthat/test_kmeans_viz.R index 320f4b7..373ecd8 100644 --- a/tests/testthat/test_kmeans_viz.R +++ b/tests/testthat/test_kmeans_viz.R @@ -2,10 +2,10 @@ context("kmeans_viz") test_that("plot_kmeans() returns a ggplot2 object", { - expect_equal( - class(plot_kmeans(mtcars, mpg, wt, group = am)), - c("gg", "ggplot") - ) + p <- plot_kmeans(mtcars, mpg, wt, group = am) + # "ggplot" is for ggplot2 3.5.2 and lower + # "ggplot2::ggplot" is for ggplot2 4.0.0 and above + expect_true(inherits(p, c("ggplot", "ggplot2::ggplot"))) }) test_that("plot_kmeans() returns error when no group is passed", {