Skip to content

Commit

Permalink
Updating shinytests to reflect current reactivity in dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
GemmaSelby29 committed Jan 30, 2024
1 parent ccf92bd commit f2075c9
Show file tree
Hide file tree
Showing 31 changed files with 1,581 additions and 1,207 deletions.
6 changes: 3 additions & 3 deletions tests/testthat/_snaps/UI_tests/001.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"ts_choice": "latestweeks"
},
"output": {
"daily_schools_count": "18,624 schools provided information on the latest full day of data, i.e. 2023-12-08",
"headline_update_date": "Data was last updated on 2023-12-21.",
"homepage_update_dates": "Data was last updated on 2023-12-21 and is next expected to be updated on 2024-01-11. The latest full week of data was the week commencing 2023-12-04."
"daily_schools_count": "18,779 schools provided information on the latest full day of data, i.e. 2024-01-12",
"headline_update_date": "Data was last updated on 2024-01-25.",
"homepage_update_dates": "Data was last updated on 2024-01-25 and is next expected to be updated on 2024-02-08. The latest full week of data was the week commencing 2024-01-08."
}
}
Binary file added tests/testthat/_snaps/UI_tests/001_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
356 changes: 356 additions & 0 deletions tests/testthat/_snaps/UI_tests/002.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,356 @@
{
"input": {
"dash": "headlines",
"geography_choice": "National",
"la_choice": "Derby",
"link_to_headlines_tab": 0,
"link_to_la_tab": 0,
"link_to_reasons_tab": 0,
"measure_choice": "Overall",
"navlistPanel": "dashboard",
"region_choice": "East Midlands",
"school_choice": "Primary",
"ts_choice": "latestweeks"
},
"output": {
"absence_rates_daily_plot": {
"x": {
"layout": {
"margin": {
"b": 40,
"l": 60,
"t": 80,
"r": 10
},
"xaxis": {
"domain": [
0,
1
],
"automargin": true,
"title": "Date",
"tickvals": [
"2024-01-08",
"2024-01-09",
"2024-01-10",
"2024-01-11",
"2024-01-12"
],
"zeroline": true,
"zerolinewidth": 2,
"zerolinecolor": "Grey"
},
"yaxis": {
"domain": [
0,
1
],
"automargin": true,
"rangemode": "tozero",
"title": "Absence rate (%)",
"zeroline": true,
"zerolinewidth": 2,
"zerolinecolor": "Grey"
},
"hovermode": "x unified",
"legend": {
"font": {
"size": 11
},
"orientation": "h",
"yanchor": "top",
"y": -0.5,
"xanchor": "center",
"x": 0.5
},
"title": "Daily summary of absence rates for primary<br> state-funded schools at national level",
"font": {
"family": "arial",
"size": 10,
"color": "grey"
},
"showlegend": true
},
"source": "A",
"config": {
"modeBarButtonsToAdd": [
"hoverclosest",
"hovercompare"
],
"showSendToCloud": false
},
"data": [
{
"mode": "lines+markers",
"type": "scatter",
"marker": {
"color": "rgba(31,119,180,1)",
"line": {
"color": "rgba(31,119,180,1)"
}
},
"error_y": {
"color": "rgba(31,119,180,1)"
},
"error_x": {
"color": "rgba(31,119,180,1)"
},
"line": {
"color": "rgba(31,119,180,1)"
},
"xaxis": "x",
"yaxis": "y",
"frame": null
},
{
"mode": "markers+lines",
"type": "scatter",
"x": [
"2024-01-08",
"2024-01-09",
"2024-01-10",
"2024-01-11",
"2024-01-12"
],
"y": [
5.4705371037641797,
4.96473329455445,
4.7480287455327703,
4.7678121074326896,
5.4924713349921896
],
"line": {
"color": "#12436D"
},
"marker": {
"color": "#12436D",
"line": {
"color": "rgba(255,127,14,1)"
}
},
"name": "Overall absence rate",
"hovertemplate": [
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%"
],
"error_y": {
"color": "rgba(255,127,14,1)"
},
"error_x": {
"color": "rgba(255,127,14,1)"
},
"xaxis": "x",
"yaxis": "y",
"frame": null
},
{
"mode": "markers+lines",
"type": "scatter",
"x": [
"2024-01-08",
"2024-01-09",
"2024-01-10",
"2024-01-11",
"2024-01-12"
],
"y": [
3.41669252226162,
3.2244746114714902,
3.1876699936406299,
3.2716828509880198,
3.82953539829637
],
"line": {
"color": "#28A197"
},
"marker": {
"color": "#28A197",
"line": {
"color": "rgba(44,160,44,1)"
}
},
"name": "Authorised absence rate",
"hovertemplate": [
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%"
],
"error_y": {
"color": "rgba(44,160,44,1)"
},
"error_x": {
"color": "rgba(44,160,44,1)"
},
"xaxis": "x",
"yaxis": "y",
"frame": null
},
{
"mode": "markers+lines",
"type": "scatter",
"x": [
"2024-01-08",
"2024-01-09",
"2024-01-10",
"2024-01-11",
"2024-01-12"
],
"y": [
2.0538445815025601,
1.7402586830829601,
1.56035875189214,
1.49612925644467,
1.6629359366958201
],
"line": {
"color": "#F46A25"
},
"marker": {
"color": "#F46A25",
"line": {
"color": "rgba(214,39,40,1)"
}
},
"name": "Unauthorised absence rate",
"hovertemplate": [
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%",
"%{y:.1f}%"
],
"error_y": {
"color": "rgba(214,39,40,1)"
},
"error_x": {
"color": "rgba(214,39,40,1)"
},
"xaxis": "x",
"yaxis": "y",
"frame": null
}
],
"highlight": {
"on": "plotly_click",
"persistent": false,
"dynamic": false,
"selectize": false,
"opacityDim": 0.20000000000000001,
"selected": {
"opacity": 1
},
"debounce": 0
},
"shinyEvents": [
"plotly_hover",
"plotly_click",
"plotly_selected",
"plotly_relayout",
"plotly_brushed",
"plotly_brushing",
"plotly_clickannotation",
"plotly_doubleclick",
"plotly_deselect",
"plotly_afterplot",
"plotly_sunburstclick"
],
"base_url": "https://plot.ly"
},
"evals": [

],
"jsHooks": [

],
"deps": [
{
"name": "setprototypeof",
"version": "0.1",
"src": {
"href": "setprototypeof-0.1"
},
"meta": null,
"script": "setprototypeof.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": false
},
{
"name": "typedarray",
"version": "0.1",
"src": {
"href": "typedarray-0.1"
},
"meta": null,
"script": "typedarray.min.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": false
},
{
"name": "jquery",
"version": "3.5.1",
"src": {
"href": "jquery-3.5.1"
},
"meta": null,
"script": "jquery.min.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "crosstalk",
"version": "1.2.1",
"src": {
"href": "crosstalk-1.2.1"
},
"meta": null,
"script": "js/crosstalk.min.js",
"stylesheet": "css/crosstalk.min.css",
"head": null,
"attachment": null,
"all_files": true
},
{
"name": "plotly-htmlwidgets-css",
"version": "2.11.1",
"src": {
"href": "plotly-htmlwidgets-css-2.11.1"
},
"meta": null,
"script": null,
"stylesheet": "plotly-htmlwidgets.css",
"head": null,
"attachment": null,
"all_files": false
},
{
"name": "plotly-main",
"version": "2.11.1",
"src": {
"href": "plotly-main-2.11.1"
},
"meta": null,
"script": "plotly-latest.min.js",
"stylesheet": null,
"head": null,
"attachment": null,
"all_files": false
}
]
},
"headline_bullet_title_nat": "Headline figures for the latest week - 2024-01-08 to 2024-01-12: primary state-funded school attendance at national level",
"weekly_absence_rate_nat": "• 5.1% of sessions were recorded as absence",
"weekly_attendance_rate_nat": "• 94.9% of sessions were recorded as attending",
"weekly_illness_rate_nat": "• 2.7% of sessions were recorded as illness"
}
}
Binary file added tests/testthat/_snaps/UI_tests/002_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f2075c9

Please sign in to comment.