diff --git a/R/tangram.R b/R/tangram.R index 5dfcb57..48c7526 100644 --- a/R/tangram.R +++ b/R/tangram.R @@ -58,7 +58,7 @@ tangram_deps <- function() { addTangram <- function(map, scene = NULL, layerId = NULL, group = NULL, options = NULL) { if ((is.null(scene) || !is.character(scene) || - (!gsub(".*\\.", "", scene) %in% c("yaml", "zip")))) { + (!gsub(".*\\.", "", scene) %in% c("yaml", "zip")))) { stop( "The scene must point to a valid .yaml or .zip file.\n", "See the documentation for further information." diff --git a/R/timeslider.R b/R/timeslider.R index f68b86e..9d6162b 100644 --- a/R/timeslider.R +++ b/R/timeslider.R @@ -3,7 +3,8 @@ timesliderDependencies <- function() { htmlDependency( "lfx-timeslider", "1.0.0", src = system.file("htmlwidgets/lfx-timeslider", - package = "leaflet.extras2"), + package = "leaflet.extras2" + ), stylesheet = "jquery-ui.css", script = c( "jquery-ui.min.js", @@ -109,8 +110,10 @@ addTimeslider <- function(map, data, radius = 10, ## Add Deps and invoke Leaflet map$dependencies <- c(map$dependencies, timesliderDependencies()) - invokeMethod(map, NULL, "addTimeslider", data, options, - popupOptions, labelOptions) %>% + invokeMethod( + map, NULL, "addTimeslider", data, options, + popupOptions, labelOptions + ) %>% expandLimits(bbox[c(2, 4)], bbox[c(1, 3)]) } diff --git a/R/velocity.R b/R/velocity.R index e2cce38..f8f1cb1 100644 --- a/R/velocity.R +++ b/R/velocity.R @@ -3,7 +3,8 @@ velocityDependencies <- function() { htmlDependency( "lfx-velocity", "1.0.0", src = system.file("htmlwidgets/lfx-velocity", - package = "leaflet.extras2"), + package = "leaflet.extras2" + ), script = c( "leaflet-velocity.js", "leaflet-velocity-bindings.js" diff --git a/data-raw/data-raw.R b/data-raw/data-raw.R index 490eab6..9469b67 100644 --- a/data-raw/data-raw.R +++ b/data-raw/data-raw.R @@ -1,6 +1,8 @@ gibs_layerslink <- paste0( system.file("htmlwidgets/lfx-gibs", - package = "leaflet.extras2"), "/gibs_layers_meta.json") + package = "leaflet.extras2" + ), "/gibs_layers_meta.json" +) gibs_layers <- jsonify::from_json(json = gibs_layerslink, simplify = TRUE) gibs_layers <- data.frame(do.call(rbind, gibs_layers), stringsAsFactors = FALSE) gibs_layers$title <- as.character(gibs_layers$title) diff --git a/tests/testthat/test-arrowhead.R b/tests/testthat/test-arrowhead.R index bd61f53..74935c4 100644 --- a/tests/testthat/test-arrowhead.R +++ b/tests/testthat/test-arrowhead.R @@ -10,7 +10,7 @@ test_that("arrowhead", { "addArrowhead" ) expect_true(all(names(m$x$calls[[1]]$args[[10]]) %in% - c("yawn", "size", "frequency", "proportionalToTotal"))) + c("yawn", "size", "frequency", "proportionalToTotal"))) m <- leaflet() %>% clearArrowhead("groupname") m$x$calls[[length(m$x$calls)]]$method == "clearArrowhead" diff --git a/tests/testthat/test-clustercharts.R b/tests/testthat/test-clustercharts.R index 7267b76..e272d99 100644 --- a/tests/testthat/test-clustercharts.R +++ b/tests/testthat/test-clustercharts.R @@ -1,19 +1,25 @@ test_that("clustercharts", { - ## data ########## data <- sf::st_as_sf(breweries91) - data$category <- sample(c("Schwer", "Mäßig", - "Leicht", "kein Schaden"), - size = nrow(data), replace = TRUE) + data$category <- sample( + c( + "Schwer", "Mäßig", + "Leicht", "kein Schaden" + ), + size = nrow(data), replace = TRUE + ) data$label <- paste0(data$brewery, "
", data$address) data$id <- paste0("ID", seq.int(nrow(data))) - data$popup <- paste0("
", data$brewery, - "
", data$address, "
") + data$popup <- paste0( + "
", data$brewery, + "
", data$address, "
" + ) data$tosum <- sample(1:100, nrow(data), replace = TRUE) data$tosumlabel <- paste("Sum: ", data$tosum) data$web <- gsub(">(.*?)<", ">", data$tosum, "<", data$web) data$web <- ifelse(is.na(data$web), "", - paste0("
", data$web, "
")) + paste0("
", data$web, "
") + ) ## simple example ########## m <- leaflet() %>% @@ -62,8 +68,10 @@ test_that("clustercharts", { labels = c("Schwer", "Mäßig", "Leicht", "kein Schaden"), colors = c("lightblue", "orange", "lightyellow", "lightgreen") ), - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum"), + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum" + ), popupLabels = c("id", "Brauerei", "Addresse", "PLZ", "Art", "tosum") ) deps <- findDependencies(m) @@ -82,8 +90,10 @@ test_that("clustercharts", { labels = c("Schwer", "Mäßig", "Leicht", "kein Schaden"), colors = c("lightblue", "orange", "lightyellow", "lightgreen") ), - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum") + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum" + ) ) deps <- findDependencies(m) expect_equal(deps[[length(deps)]]$name, "lfx-clustercharts") @@ -108,8 +118,10 @@ test_that("clustercharts", { addClusterCharts( data = data, categoryMap = - data.frame(colors = c("lightblue", "orange", - "lightyellow", "lightgreen")) + data.frame(colors = c( + "lightblue", "orange", + "lightyellow", "lightgreen" + )) ) ) @@ -141,8 +153,10 @@ test_that("clustercharts", { data = data, categoryField = "category", categoryMap = - data.frame(colors = c("lightblue", "orange", - "lightyellow", "lightgreen")) + data.frame(colors = c( + "lightblue", "orange", + "lightyellow", "lightgreen" + )) ) ) deps <- findDependencies(m) @@ -187,10 +201,14 @@ test_that("clustercharts", { labels = c("Schwer", "Mäßig", "Leicht", "kein Schaden"), colors = c("lightblue", "orange", "lightyellow", "lightgreen") ), - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum", "tosum2"), - popupLabels = c("id", "Brauerei", "Addresse", - "PLZ", "Art", "tosum", "tosum2"), + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum", "tosum2" + ), + popupLabels = c( + "id", "Brauerei", "Addresse", + "PLZ", "Art", "tosum", "tosum2" + ), label = "label", options = clusterchartOptions(size = 50) ) @@ -226,10 +244,14 @@ test_that("clustercharts", { labels = c("Schwer", "Mäßig", "Leicht", "kein Schaden"), colors = c("lightblue", "orange", "lightyellow", "lightgreen") ), - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum", "tosum2"), - popupLabels = c("id", "Brauerei", "Addresse", - "PLZ", "Art", "tosum", "tosum2"), + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum", "tosum2" + ), + popupLabels = c( + "id", "Brauerei", "Addresse", + "PLZ", "Art", "tosum", "tosum2" + ), label = "label", options = clusterchartOptions(size = c(30, 35)) ) @@ -258,10 +280,14 @@ test_that("clustercharts", { icons = iconvec ), options = clusterchartOptions(size = 50), - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum", "tosum2"), - popupLabels = c("id", "Brauerei", "Addresse", - "PLZ", "Art", "tosum", "tosum2"), + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum", "tosum2" + ), + popupLabels = c( + "id", "Brauerei", "Addresse", + "PLZ", "Art", "tosum", "tosum2" + ), label = "label" ) deps <- findDependencies(m) @@ -303,10 +329,14 @@ test_that("clustercharts", { group = "clustermarkers", layerId = "id", clusterId = "id", - popupFields = c("id", "brewery", "address", - "zipcode", "category", "tosum", "tosum2"), - popupLabels = c("id", "Brauerei", "Addresse", - "PLZ", "Art", "tosum", "tosum2"), + popupFields = c( + "id", "brewery", "address", + "zipcode", "category", "tosum", "tosum2" + ), + popupLabels = c( + "id", "Brauerei", "Addresse", + "PLZ", "Art", "tosum", "tosum2" + ), label = "label", markerOptions = markerOptions( interactive = TRUE, @@ -318,21 +348,27 @@ test_that("clustercharts", { riseOnHover = TRUE, riseOffset = 400 ), - legendOptions = list(position = "bottomright", - title = "Unfälle im Jahr 2003"), + legendOptions = list( + position = "bottomright", + title = "Unfälle im Jahr 2003" + ), clusterOptions = markerClusterOptions( showCoverageOnHover = TRUE, zoomToBoundsOnClick = TRUE, spiderfyOnMaxZoom = TRUE, removeOutsideVisibleBounds = TRUE, - spiderLegPolylineOptions = list(weight = 1.5, - color = "#222", opacity = 0.5), + spiderLegPolylineOptions = list( + weight = 1.5, + color = "#222", opacity = 0.5 + ), freezeAtZoom = TRUE, clusterPane = "clusterpane", spiderfyDistanceMultiplier = 2 ), labelOptions = labelOptions(opacity = 0.8, textsize = "14px"), - popupOptions = popupOptions(maxWidth = 900, - minWidth = 200, keepInView = TRUE) + popupOptions = popupOptions( + maxWidth = 900, + minWidth = 200, keepInView = TRUE + ) ) }) diff --git a/tests/testthat/test-contextmenu.R b/tests/testthat/test-contextmenu.R index adcb4dc..7a7ab7f 100644 --- a/tests/testthat/test-contextmenu.R +++ b/tests/testthat/test-contextmenu.R @@ -5,7 +5,8 @@ test_that("contextmenu", { contextmenuItems = context_mapmenuItems( context_menuItem("Zoom Out", "function(e) {this.zoomOut()}", - disabled = FALSE), + disabled = FALSE + ), "-", context_menuItem("Zoom In", "function(e) {this.zoomIn()}") ) @@ -44,7 +45,8 @@ test_that("contextmenu", { "showContextmenu" ) expect_true(all( - colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat"))) + colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat") + )) m <- m %>% showContextmenu(lat = 49.79433, lng = 11.50941) expect_equal( @@ -52,7 +54,8 @@ test_that("contextmenu", { "showContextmenu" ) expect_true(all( - colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat"))) + colnames(m$x$calls[[length(m$x$calls)]]$args[[1]]) %in% c("lng", "lat") + )) m <- m %>% hideContextmenu() expect_equal( diff --git a/tests/testthat/test-divicon.R b/tests/testthat/test-divicon.R index 9078599..1a567de 100644 --- a/tests/testthat/test-divicon.R +++ b/tests/testthat/test-divicon.R @@ -4,8 +4,10 @@ library(sf) df <- sf::st_as_sf(atlStorms2005) df <- suppressWarnings(st_cast(df, "POINT")) df <- df[sample(1:nrow(df), 50, replace = FALSE), ] -df$classes <- sample(x = c("myclass1", "myclass2", "myclass3"), - nrow(df), replace = TRUE) +df$classes <- sample( + x = c("myclass1", "myclass2", "myclass3"), + nrow(df), replace = TRUE +) df$ID <- paste0("ID_", 1:nrow(df)) df$lon <- st_coordinates(df)[, 1] df$lat <- st_coordinates(df)[, 2] @@ -27,16 +29,20 @@ test_that("addDivicon works", { className = ~ paste("globalclass", classes), html = ~ paste0("
", Name, "
") ) - expect_true(any(sapply(map$dependencies, - function(dep) dep$name == "lfx-divicon"))) + expect_true(any(sapply( + map$dependencies, + function(dep) dep$name == "lfx-divicon" + ))) expect_is(map, "leaflet") expect_identical(map$x$calls[[2]]$method, "addDivicon") expect_identical(map$x$calls[[2]]$args[[3]], df$ID) expect_identical(map$x$calls[[2]]$args[[4]], NULL) expect_identical(map$x$calls[[2]]$args[[5]], leaflet::markerOptions()) expect_identical(map$x$calls[[2]]$args[[6]], paste("globalclass", df$classes)) - expect_identical(map$x$calls[[2]]$args[[7]], - paste0("
", df$Name, "
")) + expect_identical( + map$x$calls[[2]]$args[[7]], + paste0("
", df$Name, "
") + ) expect_identical(map$x$calls[[2]]$args[[8]], NULL) expect_identical(map$x$calls[[2]]$args[[9]], NULL) expect_identical(map$x$calls[[2]]$args[[10]], NULL) @@ -45,8 +51,10 @@ test_that("addDivicon works", { expect_identical(map$x$calls[[2]]$args[[13]], NULL) # Test 2: Passing a group - df$groups <- sample(x = c("myclass1", "myclass2", "myclass3"), - nrow(df), replace = TRUE) + df$groups <- sample( + x = c("myclass1", "myclass2", "myclass3"), + nrow(df), replace = TRUE + ) map <- generate_test_map() %>% addDivicon( data = df, @@ -61,8 +69,10 @@ test_that("addDivicon works", { expect_identical(map$x$calls[[2]]$args[[4]], df$groups) expect_identical(map$x$calls[[2]]$args[[5]], leaflet::markerOptions()) expect_identical(map$x$calls[[2]]$args[[6]], paste("globalclass", df$classes)) - expect_identical(map$x$calls[[2]]$args[[7]], - paste0("
", df$Name, "
")) + expect_identical( + map$x$calls[[2]]$args[[7]], + paste0("
", df$Name, "
") + ) expect_identical(map$x$calls[[2]]$args[[8]], NULL) expect_identical(map$x$calls[[2]]$args[[9]], NULL) expect_identical(map$x$calls[[2]]$args[[10]], NULL) @@ -89,8 +99,10 @@ test_that("addDivicon works", { expect_identical(map$x$calls[[2]]$args[[4]], df$groups) expect_identical(map$x$calls[[2]]$args[[5]], leaflet::markerOptions()) expect_identical(map$x$calls[[2]]$args[[6]], paste("globalclass", df$classes)) - expect_identical(map$x$calls[[2]]$args[[7]], - paste0("
", df$Name, "
")) + expect_identical( + map$x$calls[[2]]$args[[7]], + paste0("
", df$Name, "
") + ) expect_identical(map$x$calls[[2]]$args[[8]], paste0(df$ID, ": ", df$Name)) expect_identical(map$x$calls[[2]]$args[[9]], popupOptions(minWidth = 400)) expect_identical(map$x$calls[[2]]$args[[10]], df$groups) @@ -119,8 +131,10 @@ test_that("addDivicon works", { expect_identical(map$x$calls[[2]]$args[[4]], df$groups) expect_identical(map$x$calls[[2]]$args[[5]], leaflet::markerOptions()) expect_identical(map$x$calls[[2]]$args[[6]], paste("globalclass", df$classes)) - expect_identical(map$x$calls[[2]]$args[[7]], - paste0("
", df$Name, "
")) + expect_identical( + map$x$calls[[2]]$args[[7]], + paste0("
", df$Name, "
") + ) expect_identical(map$x$calls[[2]]$args[[8]], paste0(df$ID, ": ", df$Name)) expect_identical(map$x$calls[[2]]$args[[9]], popupOptions(minWidth = 400)) expect_identical(map$x$calls[[2]]$args[[10]], df$groups) diff --git a/tests/testthat/test-heightgraph.R b/tests/testthat/test-heightgraph.R index e483d1b..386022f 100644 --- a/tests/testthat/test-heightgraph.R +++ b/tests/testthat/test-heightgraph.R @@ -34,8 +34,11 @@ data <- structure( ) ), row.names = 4L, class = c("sf", "data.frame"), sf_column = "geometry", - agr = structure(c(Name = NA_integer_, - MaxWind = NA_integer_, MinPress = NA_integer_), + agr = structure( + c( + Name = NA_integer_, + MaxWind = NA_integer_, MinPress = NA_integer_ + ), levels = c("constant", "aggregate", "identity"), class = "factor" ) ) diff --git a/tests/testthat/test-leafletsync.R b/tests/testthat/test-leafletsync.R index cb157eb..2d21e45 100644 --- a/tests/testthat/test-leafletsync.R +++ b/tests/testthat/test-leafletsync.R @@ -5,7 +5,8 @@ test_that("Leaflet Sync works", { deps <- findDependencies(m) expect_equal(deps[[length(deps)]]$name, "lfx-leafletsync") expect_true(all(deps[[length(deps)]]$script %in% c( - "L.Map.Sync.js", "leafletsync-bindings.js"))) + "L.Map.Sync.js", "leafletsync-bindings.js" + ))) m <- leaflet() %>% diff --git a/tests/testthat/test-movingmarker.R b/tests/testthat/test-movingmarker.R index 23286c3..c733b21 100644 --- a/tests/testthat/test-movingmarker.R +++ b/tests/testthat/test-movingmarker.R @@ -1,14 +1,16 @@ library(sf) ## DATA ####################### df <- new("SpatialLinesDataFrame", - data = structure(list(Name = structure(1L, levels = c( - "ALPHA", - "ARLENE", "BRET", "CINDY", "DELTA", "DENNIS", "EMILY", "EPSILON", - "FRANKLIN", "GAMMA", "GERT", "HARVEY", "IRENE", "JOSE", "KATRINA", - "LEE", "MARIA", "NATE", "OPHELIA", "PHILIPPE", "RITA", "TEN", - "TWENTY-TWO", "WILMA" - ), class = "factor"), MaxWind = 45, MinPress = 998), - row.names = 1L, class = "data.frame"), + data = structure( + list(Name = structure(1L, levels = c( + "ALPHA", + "ARLENE", "BRET", "CINDY", "DELTA", "DENNIS", "EMILY", "EPSILON", + "FRANKLIN", "GAMMA", "GERT", "HARVEY", "IRENE", "JOSE", "KATRINA", + "LEE", "MARIA", "NATE", "OPHELIA", "PHILIPPE", "RITA", "TEN", + "TWENTY-TWO", "WILMA" + ), class = "factor"), MaxWind = 45, MinPress = 998), + row.names = 1L, class = "data.frame" + ), lines = list(new("Lines", Lines = list(new("Line", coords = structure(c( -67.5, -68.5, -69.6, -70.5, -71.3, -72.2, -72.7, -72.9, -73, -72.4, @@ -22,7 +24,8 @@ df <- new("SpatialLinesDataFrame", "y" ), c("min", "max"))), proj4string = new( "CRS", - projargs = "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs") + projargs = "+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs" + ) ) ## TESTS ####################### diff --git a/tests/testthat/test-osmbuildings.R b/tests/testthat/test-osmbuildings.R index 64501ae..eaf3d9c 100644 --- a/tests/testthat/test-osmbuildings.R +++ b/tests/testthat/test-osmbuildings.R @@ -1,4 +1,3 @@ - create_test_map <- function() { leaflet() %>% addTiles() } @@ -11,14 +10,17 @@ test_that("addBuildings adds dependencies and invokes method correctly", { map <- addBuildings(map) # Check if the dependencies are added - expect_true(any(sapply(map$dependencies, - function(dep) dep$name) == "lfx-building")) + expect_true(any(sapply( + map$dependencies, + function(dep) dep$name + ) == "lfx-building")) # Check if invokeMethod is called with correct arguments expect_equal(map$x$calls[[2]]$method, "addBuilding") expect_equal( map$x$calls[[2]]$args[[1]], - "https://{s}.data.osmbuildings.org/0.2/59fcc2e8/tile/{z}/{x}/{y}.json") + "https://{s}.data.osmbuildings.org/0.2/59fcc2e8/tile/{z}/{x}/{y}.json" + ) }) test_that("addBuildings handles custom eachFn, clickFn, and data", { @@ -51,8 +53,10 @@ test_that("addBuildings handles custom eachFn, clickFn, and data", { ) ) - map <- addBuildings(map, eachFn = each_fn, - clickFn = click_fn, data = geojson_data) + map <- addBuildings(map, + eachFn = each_fn, + clickFn = click_fn, data = geojson_data + ) # Check if the JavaScript functions and data are passed correctly expect_equal(map$x$calls[[2]]$args[[3]], each_fn) @@ -77,8 +81,10 @@ test_that("updateBuildingTime updates the time correctly", { # Test suite for setBuildingStyle test_that("setBuildingStyle applies styles correctly", { map <- create_test_map() - style <- list(color = "#0000ff", wallColor = "#0000ff", - roofColor = "blue", shadows = FALSE) + style <- list( + color = "#0000ff", wallColor = "#0000ff", + roofColor = "blue", shadows = FALSE + ) map <- addBuildings(map) %>% setBuildingStyle(style) %>% @@ -98,8 +104,10 @@ test_that("setBuildingStyle uses default styles if not provided", { # map # Check if invokeMethod is called with the default styles - default_style <- list(color = "#ffcc00", wallColor = "#ffcc00", - roofColor = "orange", shadows = TRUE) + default_style <- list( + color = "#ffcc00", wallColor = "#ffcc00", + roofColor = "orange", shadows = TRUE + ) expect_equal(map$x$calls[[3]]$"method", "setBuildingStyle") expect_equal(map$x$calls[[3]]$args[[1]], default_style) }) diff --git a/tests/testthat/test-playback.R b/tests/testthat/test-playback.R index f597177..c21e9d3 100644 --- a/tests/testthat/test-playback.R +++ b/tests/testthat/test-playback.R @@ -134,15 +134,19 @@ test_that("playback", { structure(c(11.5772056036448, 49.9436206656224), class = c("XY", "POINT", "sfg")) ), precision = 0, - bbox = structure(c(xmin = 11.5772056036448, - ymin = 49.9434124224934, - xmax = 11.5779536762059, - ymax = 49.9447628006851), + bbox = structure( + c( + xmin = 11.5772056036448, + ymin = 49.9434124224934, + xmax = 11.5779536762059, + ymax = 49.9447628006851 + ), class = "bbox" ), crs = structure(list( epsg = 4326L, - proj4string = "+proj=longlat +datum=WGS84 +no_defs"), class = "crs"), + proj4string = "+proj=longlat +datum=WGS84 +no_defs" + ), class = "crs"), n_empty = 0L, class = c("sfc_POINT", "sfc"), ids = 100L ) ), diff --git a/tests/testthat/test-sidebar.R b/tests/testthat/test-sidebar.R index 437e7fa..40d8ba4 100644 --- a/tests/testthat/test-sidebar.R +++ b/tests/testthat/test-sidebar.R @@ -83,12 +83,18 @@ test_that("sidebar-error", { expect_error( sidebar_tabs( list(tags$i(class = "person"), tags$i(class = "person")), - sidebar_pane(id = "home_id", - icon = tags$i(class = "person"), tagList()), - sidebar_pane(id = "profile_id", - icon = tags$i(class = "person"), tagList()), - sidebar_pane(id = "messages_id", - icon = tags$i(class = "person"), tagList()) + sidebar_pane( + id = "home_id", + icon = tags$i(class = "person"), tagList() + ), + sidebar_pane( + id = "profile_id", + icon = tags$i(class = "person"), tagList() + ), + sidebar_pane( + id = "messages_id", + icon = tags$i(class = "person"), tagList() + ) ) ) }) diff --git a/tests/testthat/test-sidebyside.R b/tests/testthat/test-sidebyside.R index 58cd953..ddeb4cc 100644 --- a/tests/testthat/test-sidebyside.R +++ b/tests/testthat/test-sidebyside.R @@ -14,8 +14,10 @@ test_that("sidebyside", { data = breweries91[1:15, ], color = "blue", group = "blue", options = pathOptions(pane = "left") ) %>% - addCircleMarkers(data = breweries91[15:20, ], - color = "yellow", group = "yellow") %>% + addCircleMarkers( + data = breweries91[15:20, ], + color = "yellow", group = "yellow" + ) %>% addCircleMarkers( data = breweries91[15:30, ], color = "red", group = "red", options = pathOptions(pane = "right") diff --git a/tests/testthat/test-spin.R b/tests/testthat/test-spin.R index e92ce77..fa1f14c 100644 --- a/tests/testthat/test-spin.R +++ b/tests/testthat/test-spin.R @@ -15,6 +15,8 @@ test_that("spin", { expect_false(m$x$calls[[length(m$x$calls)]]$args[[1]]) m <- m %>% startSpinner(options = list("lines" = 7, "width" = 12)) - expect_equal(m$x$calls[[length(m$x$calls)]]$args[[2]], - list("lines" = 7, "width" = 12)) + expect_equal( + m$x$calls[[length(m$x$calls)]]$args[[2]], + list("lines" = 7, "width" = 12) + ) }) diff --git a/tests/testthat/test-tangram.R b/tests/testthat/test-tangram.R index 24d5660..f5697a3 100644 --- a/tests/testthat/test-tangram.R +++ b/tests/testthat/test-tangram.R @@ -1,6 +1,7 @@ test_that("tangram", { scene <- system.file("examples/tangram/www/scene.yaml", - package = "leaflet.extras2") + package = "leaflet.extras2" + ) m <- leaflet() %>% addTangram(scene = scene, group = "tangram") %>% diff --git a/tests/testthat/test-wms.R b/tests/testthat/test-wms.R index 4055aca..99d8a91 100644 --- a/tests/testthat/test-wms.R +++ b/tests/testthat/test-wms.R @@ -20,5 +20,5 @@ test_that("wms", { test_that("wms-error", { expect_error(leaflet() %>% - addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms")) + addWMS(baseUrl = "https://maps.dwd.de/geoserver/dwd/wms")) })