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

Improve plotly+shinytest experience #1379

Merged
merged 3 commits into from
Dec 6, 2018
Merged

Improve plotly+shinytest experience #1379

merged 3 commits into from
Dec 6, 2018

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Oct 29, 2018

This PR addresses the main problem in rstudio/shinytest#174, but it's worth noting there are a couple remaining issues to be aware of:

Testing notes

Install devtools::install_github("ropensci/plotly#1379"), then use shinytest to record and test the following app -- https://github.com/ropensci/plotly/tree/master/inst/examples/shiny/Diamonds

Make sure you don't get false positive test failures when running the tests.

Here is some code to help with those tasks:

git clone https://github.com/ropensci/plotly.git
cd plotly
R
shinytest::recordTest("inst/examples/shiny/Movies/")
shinytest::testApp("inst/examples/shiny/Movies/")

R/shiny.R Outdated
renderFunc,
function(value) {
json <- from_JSON_safe(value)
json$x <- json$x[!names(json$x) %in% c("visdat", "cur_data", "attrs")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't important, but I find it slightly clearer to use setdiff(), as in:

 json$x[setdiff(names(json$x), c("visdat", "cur_data", "attrs"))]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants