Skip to content

Commit

Permalink
update to shiny test to fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-bennettWk committed Oct 17, 2024
1 parent 31b129c commit 1b06f8d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 43 deletions.
58 changes: 29 additions & 29 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
# -----------------------------------------------------------------------------------------------------------------------------
# ---- ANCILLARY DATA FOR EES ----
# -----------------------------------------------------------------------------------------------------------------------------
ancillary_data_numbers <- student_numbers %>%
pivot_longer(!c(Qual_Description, SUBLEVNO, Potential_Level, ASIZE, GSIZE, MAPPING, Subject, gradeStructure, PRIOR_BAND, SUBJ, SIZE, QUAL_ID, ROW_ID),
names_to = "grade",
values_to = "count") %>%
select(qualification_name = Qual_Description,
qualification_code = SUBLEVNO,
subject_name = Subject,
subject_code = SUBJ,
size = SIZE,
grade_structure = gradeStructure,
prior_attainment_band = PRIOR_BAND,
grade,
count) %>%
filter(!is.na(count)) %>%
arrange(qualification_code, subject_code, size, grade_structure, prior_attainment_band, grade)
ancillary_data_percentages <- student_percentages %>%
pivot_longer(!c(Qual_Description, SUBLEVNO, Potential_Level, ASIZE, GSIZE, MAPPING, Subject, gradeStructure, PRIOR_BAND, SUBJ, SIZE, QUAL_ID, ROW_ID),
names_to = "grade",
values_to = "percentage") %>%
select(qualification_name = Qual_Description,
qualification_code = SUBLEVNO,
subject_name = Subject,
subject_code = SUBJ,
size = SIZE,
grade_structure = gradeStructure,
prior_attainment_band = PRIOR_BAND,
grade,
percentage) %>%
filter(percentage != "NA%") %>%
Expand Down Expand Up @@ -510,3 +481,32 @@ shinytest2::record_test()
renv::status()
renv::snapshot()
renv::status()
shiny::runApp()
testthat::snapshot_review('shinytest2/')
shinytest2::test_app()
shinytest2::record_test()
shinytest2::record_test()
testthat::snapshot_review('shinytest2/')
shinytest2::test_app()
runApp()
shinytest2::test_app()
runApp()
runApp()
runApp()
shiny::runApp()
shinytest2::test_app()
shinytest2::test_app()
shinytest2::use_shinytest2(".", setup = TRUE)
shinytest2::test_app()
shinytest2::record_test()
shinytest2::test_app()
shinytest2::test_app()
shinytest2::record_test()
shinytest2::record_test()
renv::status()
renv::snapshot()
renv::status()
shinytest2::record_test()
renv::status()
renv::snapshot()
shinytest2::test_app()
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"ReportYr_select": "2023",
"cookies": [
"GA1.1.1784488804.1728980230",
"GS1.1.1728987874.2.0.1728987874.0.0.0",
"granted"
"GS1.1.1729152208.1.1.1729152369.0.0.0"
],
"cookies_banner-cookies_accept": 1,
"cookies_banner-cookies_accept": 0,
"cookies_banner-cookies_link": 0,
"cookies_banner-cookies_reject": 0,
"cookies_panel-cookies_analytics": "no",
Expand Down Expand Up @@ -45,7 +44,7 @@
"example_table_rows_selected": null,
"example_table_search": "",
"example_table_state": [
"1728987874960",
"1729152370040",
"0",
"10",
"",
Expand Down
19 changes: 9 additions & 10 deletions tests/testthat/test-shinytest2.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ library(shinytest2)

test_that("{shinytest2} recording: ks5-transition-matrices", {
app <- AppDriver$new(name = "ks5-transition-matrices", height = 911, width = 1619)
app$set_inputs(
cookies = c("GA1.1.1784488804.1728980230", "GS1.1.1729152208.1.1.1729152369.0.0.0"),
allow_no_input_binding_ = TRUE
)
app$set_inputs(example_table_rows_current = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(example_table_rows_all = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(example_table_state = c(
1728987874960, 0, 10, "", TRUE, FALSE, TRUE,
1729152370040, 0, 10, "", TRUE, FALSE, TRUE,
c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE), c(
TRUE, "",
TRUE, FALSE, TRUE
Expand All @@ -15,17 +19,12 @@ test_that("{shinytest2} recording: ks5-transition-matrices", {
), c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE),
c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE)
), allow_no_input_binding_ = TRUE)
app$click("cookies_banner-cookies_accept")
app$set_inputs(cookies = c(
"GA1.1.1784488804.1728980230", "GS1.1.1728987874.2.0.1728987874.0.0.0",
"granted"
), allow_no_input_binding_ = TRUE)
app$expect_values()
app$set_inputs(navlistPanel = "dashboard")
app$set_inputs(tm_table_rows_current = c(1, 2, 3, 4, 5, 6, 7, 8), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_rows_all = c(1, 2, 3, 4, 5, 6, 7, 8), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_state = c(
1728987905305, 0, 10, "", TRUE, FALSE, TRUE,
1729152378179, 0, 10, "", TRUE, FALSE, TRUE,
c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE), c(
TRUE, "",
TRUE, FALSE, TRUE
Expand All @@ -43,7 +42,7 @@ test_that("{shinytest2} recording: ks5-transition-matrices", {
app$set_inputs(tm_table_rows_current = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_rows_all = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_state = c(
1728987938055, 0, 10, "", TRUE, FALSE, TRUE,
1729152396312, 0, 10, "", TRUE, FALSE, TRUE,
c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE), c(
TRUE, "",
TRUE, FALSE, TRUE
Expand All @@ -57,7 +56,7 @@ test_that("{shinytest2} recording: ks5-transition-matrices", {
app$set_inputs(tm_table_rows_current = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_rows_all = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), allow_no_input_binding_ = TRUE)
app$set_inputs(tm_table_state = c(
1728987947448, 0, 10, "", TRUE, FALSE, TRUE,
1729152401377, 0, 10, "", TRUE, FALSE, TRUE,
c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE), c(
TRUE, "",
TRUE, FALSE, TRUE
Expand All @@ -67,5 +66,5 @@ test_that("{shinytest2} recording: ks5-transition-matrices", {
), c(TRUE, "", TRUE, FALSE, TRUE), c(TRUE, "", TRUE, FALSE, TRUE),
c(TRUE, "", TRUE, FALSE, TRUE)
), allow_no_input_binding_ = TRUE)
app$set_inputs(chart_band = "6-<7")
app$set_inputs(chart_band = "4-<5")
})

0 comments on commit 1b06f8d

Please sign in to comment.