Skip to content

Commit

Permalink
fix test + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Nov 14, 2023
1 parent b9608fe commit c1cdca9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ importFrom(htmltools,doRenderTags)
importFrom(htmltools,htmlDependency)
importFrom(htmltools,singleton)
importFrom(htmltools,tagAppendAttributes)
importFrom(htmltools,tagAppendChild)
importFrom(htmltools,tagList)
importFrom(htmltools,tags)
importFrom(htmltools,validateCssUnit)
Expand Down
7 changes: 4 additions & 3 deletions R/import-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#' @name import-file
#'
#' @importFrom shiny NS fileInput tableOutput actionButton icon
#' @importFrom htmltools tags tagAppendAttributes css
#' @importFrom htmltools tags tagAppendAttributes css tagAppendChild
#' @importFrom shinyWidgets pickerInput numericInputIcon textInputIcon dropMenu
#' @importFrom phosphoricons ph
#'
#' @example examples/from-file.R
import_file_ui <- function(id,
Expand Down Expand Up @@ -69,14 +70,14 @@ import_file_ui <- function(id,
min = 0,
icon = list("n =")
),
htmltools::tagAppendChild(
tagAppendChild(
textInputIcon(
inputId = ns("na_label"),
label = i18n("Missing values character(s):"),
value = ",NA",
icon = list("NA")
),
shiny::helpText("if several use a ',' to separate them")
shiny::helpText(ph("info"), "if several use a comma (',') to separate them")
),
textInputIcon(
inputId = ns("dec"),
Expand Down
2 changes: 2 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,7 @@ header_with_classes <- function(data) {


split_char <- function(x, split = ",") {
if (is.null(x))
return(NULL)
unlist(strsplit(x, split = split))
}
1 change: 1 addition & 0 deletions man/import-file.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/import-modal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/testthat/test-import-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ test_that("import_file_server works", {
skip_rows = 0,
confirm = 0,
dec = ".",
encoding = "UTF-8"
encoding = "UTF-8",
na_label = ",NA"
)
expect_is(imported_rv$data, "data.frame")
expect_is(session$getReturned()$data(), "data.frame")
Expand Down

0 comments on commit c1cdca9

Please sign in to comment.