-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5470659
commit 9bb28df
Showing
9 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
library(shiny) | ||
library(shinyMobile) | ||
|
||
app <- shinyApp( | ||
ui = f7Page( | ||
title = "My app", | ||
f7SingleLayout( | ||
navbar = f7Navbar(title = "Update autocomplete"), | ||
f7Block(f7Button(inputId = "update", label = "Update autocomplete")), | ||
f7Block( | ||
f7AutoComplete( | ||
inputId = "myautocomplete", | ||
placeholder = "Some text here!", | ||
openIn = "dropdown", | ||
label = "Type a fruit name", | ||
choices = c( | ||
"Apple", "Apricot", "Avocado", "Banana", "Melon", | ||
"Orange", "Peach", "Pear", "Pineapple" | ||
) | ||
), | ||
verbatimTextOutput("autocompleteval") | ||
) | ||
) | ||
), | ||
server = function(input, output, session) { | ||
output$autocompleteval <- renderText(input$myautocomplete) | ||
|
||
observeEvent(input$update, { | ||
updateF7AutoComplete( | ||
inputId = "myautocomplete", | ||
value = "plip", | ||
choices = c("plip", "plap", "ploup") | ||
) | ||
}) | ||
} | ||
) | ||
|
||
if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app |
Binary file modified
BIN
-8.14 KB
(79%)
tests/testthat/_snaps/mac-4.3/f7ActionSheet/actionsheet-app-004_.new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.9 KB
tests/testthat/_snaps/mac-4.3/f7ActionSheet/actionsheet-app-005_.new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
tests/testthat/_snaps/mac-4.3/f7AutoComplete/autocomplete-app-001.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"input": { | ||
"myautocomplete": "Apple" | ||
} | ||
} |
Binary file added
BIN
+21.4 KB
tests/testthat/_snaps/mac-4.3/f7AutoComplete/autocomplete-app-001_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
tests/testthat/_snaps/mac-4.3/f7AutoComplete/autocomplete-app-002.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"input": { | ||
"myautocomplete": "plip" | ||
} | ||
} |
Binary file added
BIN
+20.2 KB
tests/testthat/_snaps/mac-4.3/f7AutoComplete/autocomplete-app-002_.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
test_that("autocomplete works", { | ||
# Don't run these tests on the CRAN build servers | ||
skip_on_cran() | ||
shiny_app_path <- | ||
system.file("examples/autocomplete/app.R", package = "shinyMobile") | ||
app <- AppDriver$new( | ||
shiny_app_path, | ||
name = "autocomplete-app", | ||
variant = platform_variant() | ||
) | ||
app$expect_values(input = "myautocomplete") | ||
app$click(selector = "#update") | ||
# Wait for any animation to complete | ||
app$wait_for_idle(1000) | ||
app$expect_values(input = "myautocomplete") | ||
}) |