You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
982B

  1. context("test-columns")
  2. test_that("bulma_column_narrow() handles viewport and logical", {
  3. expect_equal_unclass <- function(x, y) {
  4. expect_equal(unclass(x), y)
  5. }
  6. expect_equal_unclass(bulma_column_narrow("touch"), "is-narrow-touch")
  7. expect_equal_unclass(bulma_column_narrow("desktop"), "is-narrow-desktop")
  8. expect_s3_class(bulma_column_narrow("desktop"), "bulma_column_narrow")
  9. expect_equal_unclass(bulma_column_narrow(TRUE), "is-narrow")
  10. expect_equal_unclass(bulma_column_narrow(), "is-narrow")
  11. expect_null(bulma_column_narrow(FALSE))
  12. expect_error(bulma_column_narrow("touchscreen"))
  13. expect_warning(bulma_column_narrow(c("touch", "desktop")))
  14. expect_warning(bulma_column_narrow(c("touchscreen", "touch")))
  15. })
  16. test_that("bulma_columns() with single bulma_column()", {
  17. expected <- '
  18. <div class="columns is-tablet is-multiline">
  19. <div class="column">
  20. Test
  21. </div>
  22. </div>'
  23. expect_html_chr(bulma_columns(bulma_column("Test")), expected)
  24. })