-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bugfix/32 #42
base: main
Are you sure you want to change the base?
Bugfix/32 #42
Conversation
Approaches I tried before this bugfixThese were two approaches I tried by using an
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/testthat/test-empty_state.R
Outdated
it("checks the empty state component follows slider from id", { | ||
app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
app$expect_values() | ||
app$click("toggle_pannel") | ||
app$expect_values() | ||
app$stop() | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is useless.
- You have not included the snapshots generated by
app$expected_values()
, so the tests are not run against the reference, they only generate references. - Even with the snapshots, this test only verifies the values of inputs and outputs, which means that the only thing that you test is if the button was clicked. You are not testing the position of the empty state container.
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #42 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 45 45
=========================================
Hits 45 45 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comments.
|
||
The example below showcases the example of using a dynamic trigger slider that changes. | ||
|
||
The function `shiny_emptystate_updatePosition` updates the position of the #container1 after being re-positioned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it clear that this function is 1. JS 2. comes withshiny.emptystate
.
@@ -75,6 +75,18 @@ function hideEmptyState(message) { | |||
resizeObserver.unobserve(elementToReplace); | |||
} | |||
|
|||
function shiny_emptystate_updatePosition(id){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the name of the function to follow camel case, instead of a weird hybrid. updateElementPosition
should work here.
|
||
# Introduction | ||
|
||
`shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag | |
`shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially useful when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag |
|
||
# Animation example | ||
|
||
The example below showcases the example of using a dynamic trigger slider that changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain this in more detail. Also, inform the reader what would happen without the updatePosition
function.
- icon: fa-file-code-o | ||
href: index.html | ||
tutorials: | ||
text: Tutorials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new article is not a tutorial, but a small guide. Change this to "Articles".
|
||
it("checks the empty state component follows slider from id", { | ||
app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
position_1 <- app$get_html(selector = "#container2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a position, but a full HTML. The variable name is misleading.
app <- shinytest2::AppDriver$new(test_slider_app(), name = "slide_tag") | ||
position_1 <- app$get_html(selector = "#container2") | ||
app$click("toggle_pannel") | ||
position_2 <- app$get_html(selector = "#container2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a position, but a full HTML. The variable name is misleading.
position_1 <- app$get_html(selector = "#container2") | ||
app$click("toggle_pannel") | ||
position_2 <- app$get_html(selector = "#container2") | ||
expect_false(position_1 == position_2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you compare the whole HTML, this may be a false positive (some other parts of HTML will change).
|
||
`shiny.emptystate` is capable of being used for dynamic positioning trigger animations. This is specially interesting when we have UIs that change position and we want to keep the `emptystate` in the appropriate tag | ||
|
||
**Note:** This solution is only available for instant positioning animation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include the solution for the animations, provided in the issue comments.
Have you read the Contributing Guidelines?
Issue #32
Changes description
shiny_emptystate_updatePosition
that updates the position of the empty container when the selected tag id is triggeredExample:
Clearly and concisely describe what's in this pull request. Include screenshots, if necessary.