-
Notifications
You must be signed in to change notification settings - Fork 197
/
test-info_tables.R
52 lines (43 loc) · 1.28 KB
/
test-info_tables.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
context("Ensuring that the information-providing functions work as expected")
test_that("the `info_date_style()` function works correctly", {
# Expect that the `info_date_style()` function produces an
# information table with certain classes
expect_is(
info_date_style(),
c("gt_tbl", "data.frame"))
# Expect the internal source data frame to be of
# specific dimensions
expect_equal(
info_date_style() %>%
dt_data_get() %>%
dim(),
c(14, 3))
})
test_that("the `info_time_style()` function works correctly", {
# Expect that the `info_time_style()` function produces an
# information table with certain classes
expect_is(
info_time_style(),
c("gt_tbl", "data.frame"))
# Expect the internal source data frame to be of
# specific dimensions
expect_equal(
info_time_style() %>%
dt_data_get() %>%
dim(),
c(5, 3))
})
test_that("the `info_google_fonts()` function works correctly", {
# Expect that the `info_google_fonts()` function produces an
# information table with certain classes
expect_is(
info_google_fonts(),
c("gt_tbl", "data.frame"))
# Expect the internal source data frame to be of
# specific dimensions
expect_equal(
info_google_fonts() %>%
dt_data_get() %>%
dim(),
c(38, 4))
})