-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from openjusticeok/testthat
testthat
- Loading branch information
Showing
9 changed files
with
147 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
# library(testthat) | ||
# library(ojothemes) | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# test_check("ojothemes") | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(ojothemes) | ||
|
||
test_check("ojothemes") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
test_that("gt_okpi style is consistent", { | ||
data <- tibble::tibble( | ||
county = c("Tulsa", "Oklahoma"), | ||
variable1 = c(95, 85), | ||
variable2 = c(4.25, 3.12), | ||
variable3 = c("factor1", "factor2") | ||
) | ||
|
||
vdiffr::expect_doppelganger("demo-ojo_gt", { | ||
gt_okpi( | ||
data, | ||
title = "A demo table", | ||
subtitle = "Towards beauty in our tables", | ||
analyst_name = "Brancen Gregory", | ||
source = ojo_source_text("oscn") | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
test_that("theme_okpi is stable", { | ||
data <- tibble::tibble( | ||
county = c("Tulsa", "Oklahoma"), | ||
variable1 = c(95, 85), | ||
variable2 = c(4.25, 3.12), | ||
variable3 = c("factor1", "factor2") | ||
) | ||
|
||
vdiffr::expect_doppelganger("demo-theme_okpi", { | ||
ojo_set_theme() | ||
|
||
ggplot2::ggplot( | ||
data, | ||
ggplot2::aes(x = variable1, y = variable2, group = variable3) | ||
) + | ||
geom_col() | ||
}) | ||
}) |