Skip to content

Commit

Permalink
rewrite some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jun 17, 2020
1 parent 92a9f4b commit 9daeedd
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 37 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Description: Develop outstanding 'shiny' apps for 'iOS', 'Android', desktop as w
12 new widgets (expandable cards, badges, chips, timelines, gauges, progress bars, ...)
combined with the power of server-side notifications such as alerts, modals, toasts,
action sheets, sheets (and more) as well as 3 layouts (single, tabs and split).
Imports: shiny, htmltools, jsonlite, magrittr, golem
Imports: shiny, htmltools, jsonlite, magrittr
License: GPL-2
Encoding: UTF-8
URL: https://github.com/RinteRface/shinyMobile, https://rinterface.github.io/shinyMobile/
Expand Down
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ articles:
Tabs-Layout: Tabs-Layout.html
shinyMobile: shinyMobile.html
shinyMobile_tools: shinyMobile_tools.html
last_built: 2020-06-17T08:03Z
last_built: 2020-06-17T10:15Z

1 change: 0 additions & 1 deletion tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
library(testthat)
library(golem)
library(shinyMobile)

test_check("shinyMobile")
26 changes: 0 additions & 26 deletions tests/testthat/test-check-input-bindings.R

This file was deleted.

4 changes: 2 additions & 2 deletions tests/testthat/test-f7Accordion.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context("f7Accordion")

test_that("accordion", {
expect_shinytaglist(f7Accordion())
expect_true(inherits(f7Accordion(), "shiny.tag.list"))
# [[1]] is the f7InputDeps() slot
# [[2]] is the accordion wrapper slot
expect_equal(
Expand All @@ -27,7 +27,7 @@ test_that("accordion", {


test_that("accordion items", {
expect_shinytag(f7AccordionItem())
expect_true(inherits(f7AccordionItem(), "shiny.tag"))
expect_equal(f7AccordionItem()$name, "li")
expect_equal(f7AccordionItem()$attribs$class, "accordion-item")
expect_equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-f7Appbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ getInnerChildren <- function(tag) {
}

test_that("appbar", {
expect_shinytag(f7Appbar())
expect_true(inherits(f7Appbar(), "shiny.tag"))
expect_equal(f7Appbar()$attribs$class, "appbar")
expect_equal(f7Appbar()$children[[1]]$attribs$class, "appbar-inner")

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-f7Badge.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ context("f7Badge")

test_that("basic test", {
badge <- f7Badge("mybadge")
expect_shinytag(badge)
expect_true(inherits(badge, "shiny.tag"))
expect_equal(badge$name, "span")
expect_equal(badge$attribs$class, "badge")

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-f7Block.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context("f7Block")

test_that("block class", {
expect_shinytag(f7Block())
expect_true(inherits(f7Block(), "shiny.tag"))
expect_equal(f7Block()$attribs$class, "block")

# no hairlines, strong, inset, tablet
Expand Down Expand Up @@ -29,7 +29,7 @@ test_that("block class", {


test_that("blocktitle", {
expect_shinytag(f7BlockTitle())
expect_true(inherits(f7BlockTitle(), "shiny.tag"))
expect_equal(
f7BlockTitle()$attribs$class,
"block-title"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-f7Button.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context("f7Button")

test_that("button", {
expect_shinytaglist(f7Button())
expect_true(inherits(f7Button(), "shiny.tag.list"))
# deps
expect_is(f7Button()[[1]], "html_dependency")

Expand Down Expand Up @@ -31,7 +31,7 @@ test_that("button", {
context("f7Segment")

test_that("f7Segment", {
expect_shinytag(f7Segment(container = "segment"))
expect_true(inherits(f7Segment(container = "segment"), "shiny.tag"))

# error
expect_error(f7Segment(container = "row", rounded = TRUE))
Expand Down

0 comments on commit 9daeedd

Please sign in to comment.