Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep cran release #90

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tfrmtbuilder
Title: 'shiny' App Companion to the 'tfrmt' Package
Version: 0.0.6.9000
Version: 0.1.0
Authors@R:
c(person(given = "Becca",
family = "Krouse",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tfrmtbuilder development version
# tfrmtbuilder 0.1.0

* New features:
- Add ability to specify `tfrmt`, `data`, and/or `mockmode` in the `tfrmtbuilder()` function call, as an alternative to manually uploading/specifying these within the app.
Expand Down
2 changes: 0 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@

0 errors | 0 warnings | 0 notes

* This is a new release.

45 changes: 45 additions & 0 deletions tests/testthat/_snaps/e2e-auto/tfrmt_save.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"group": ["group"],
"label": ["label"],
"param": ["param"],
"value": ["value"],
"column": ["column"],
"body_plan": [
{
"group_val": [".default"],
"label_val": [".default"],
"param_val": [".default"],
"frmt": {
"expression": ["xx.x"],
"missing": {},
"scientific": {},
"transform": {}
}
}
],
"page_plan": {
"struct_list": [],
"note_loc": ["noprint"],
"max_rows": [60]
},
"row_grp_plan": {
"struct_list": [],
"label_loc": {
"location": ["indented"],
"indent": [" "]
}
},
"col_style_plan": [],
"col_plan": {
"col_plan": {
"dots": [
["group"],
["label"],
["column1"],
["column2"],
["column3"]
],
".drop": [true]
}
}
}
1 change: 1 addition & 0 deletions tests/testthat/e2e/app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tfrmtbuilder::tfrmtbuilder(run = FALSE)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ shinyApp(
exportTestValues(
settings = {vals$settings()},
valid = {vals$valid()},
initial_state = {vals$initial_stat()}
state_counter = {vals$state_counter()}
)

}
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-e2e-auto.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ test_that("End to end with mock/auto mode (no data)", {

skip_if_not(interactive())

tfrmtbuilder_app <- tfrmtbuilder(run = FALSE)
app <- shinytest2::AppDriver$new(tfrmtbuilder_app)
app_dir <- rprojroot::find_testthat_root_file("e2e")
app <- shinytest2::AppDriver$new(app_dir)

# click export tab
app$set_inputs(`tb-all_tabs` = "Export")
Expand All @@ -12,7 +12,7 @@ test_that("End to end with mock/auto mode (no data)", {
expect_snapshot_file("tfrmt_save.json")

app$get_download("tb-export-tbl_save_png", filename = "tfrmt_save.png")
expect_snapshot_file("tfrmt_save.png")
expect_true(file.exists("tfrmt_save.png"))

file.remove("tfrmt_save.json")
file.remove("tfrmt_save.png")
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/test-mod_datamapping_inputs-shinytest2.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test_that("Data-driven dropdowns produce expected results",{

expect_equal(export_vals$settings, "grp")
expect_equal(export_vals$valid, TRUE)
expect_equal(export_vals$initial_state, TRUE)
expect_equal(export_vals$state_counter, 1)


# Change selection --------------------------------------------------------
Expand All @@ -25,7 +25,7 @@ test_that("Data-driven dropdowns produce expected results",{

expect_equal(export_vals$settings, "rowlbl1")
expect_equal(export_vals$valid, TRUE)
expect_equal(export_vals$initial_state, FALSE)
expect_equal(export_vals$state_counter, 2)


# Deselect ----------------------------------------------------------------
Expand All @@ -37,7 +37,7 @@ test_that("Data-driven dropdowns produce expected results",{

expect_equal(export_vals$settings, NULL)
expect_equal(export_vals$valid, FALSE)
expect_equal(export_vals$initial_state, FALSE)
expect_equal(export_vals$state_counter, 3)

app$stop()

Expand Down Expand Up @@ -71,7 +71,7 @@ test_that("Data-driven dropdowns can be added/removed",{

expect_equal(export_vals$settings, c("grp","rowlbl2"))
expect_equal(export_vals$valid, TRUE)
expect_equal(export_vals$initial_state, FALSE)
expect_gt(export_vals$state_counter, 0)

# Add another input -------------------------------------------------------

Expand All @@ -88,7 +88,7 @@ test_that("Data-driven dropdowns can be added/removed",{

expect_equal(export_vals$settings, c("grp","rowlbl2", "rowlbl1"))
expect_equal(export_vals$valid, TRUE)
expect_equal(export_vals$initial_state, FALSE)
expect_gt(export_vals$state_counter, 0)


# Remove input ------------------------------------------------------------
Expand Down Expand Up @@ -125,7 +125,7 @@ test_that("Data-driven dropdowns can be added/removed",{

expect_equal(export_vals$settings, c("grp","rowlbl1"))
expect_equal(export_vals$valid, TRUE)
expect_equal(export_vals$initial_state, FALSE)
expect_gt(export_vals$state_counter, 0)

app$stop()

Expand Down
Loading