Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/testthat/test_kmeans_viz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down