tests/testthat/test-plots.R

context("test-plots")

test_that("plot_heatmap can accept sparseMatrix input", {
  i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
  m <- Matrix::sparseMatrix(i, j, x = x)

  p <- plot_heatmap(m)
  expect_is(p, "Heatmap")
})

test_that("incorrect labels throw an error", {
  expect_error(
    plot_dims(fsce_tidy, UMAP1, UMAP2, k_cluster, labels = LETTERS[1:10]),
    "must match factors"
  )
})

test_that("plot_pcvariance works", {
  p <- plot_pcvariance(fsce_small)
  expect_true(is(p, "ggplot"))
})
hesselberthlab/scrunchy documentation built on Nov. 11, 2019, 2:29 p.m.