11test_that(" maps_leaflet_base return maps" , {
22 skip_on_cran()
3+ skip_on_os(c(" windows" , " mac" ))
34
45 expect_silent(
56 map <- map_leaflet_base(
@@ -11,34 +12,44 @@ test_that("maps_leaflet_base return maps", {
1112 attr(map $ x , " leafletData" ),
1213 unique(finches [, c(" logger_id" , " lat" , " lon" )])
1314 )
15+
16+ skip_on_os(c(" windows" , " mac" ))
1417 expect_snapshot_value(deparse(map $ x ), style = " json2" )
1518})
1619
17- test_that(" map_leaflet() returns summary map " , {
20+ test_that(" map_leaflet() returns sum " , {
1821 skip_on_cran()
1922
20- expect_error (
23+ expect_silent (
2124 map <- map_leaflet(
2225 p = presence(visits(finches )),
2326 m = move(visits(finches )),
2427 summary = " sum"
25- ),
26- NA
28+ )
2729 )
2830 expect_s3_class(map , c(" leaflet" , " htmlwidget" ))
31+
32+ skip_on_os(c(" windows" , " mac" ))
2933 expect_snapshot_value(deparse(map $ x ), style = " json2" )
34+ })
3035
31- expect_error(
36+ test_that(" map_leaflet() returns sum_indiv" , {
37+ skip_on_cran()
38+ expect_silent(
3239 map <- map_leaflet(
3340 p = presence(visits(finches )),
3441 m = move(visits(finches )),
3542 summary = " sum_indiv"
36- ),
37- NA
43+ )
3844 )
3945 expect_s3_class(map , c(" leaflet" , " htmlwidget" ))
46+
47+ skip_on_os(c(" windows" , " mac" ))
4048 expect_snapshot_value(deparse(map $ x ), style = " json2" )
49+ })
4150
51+ test_that(" map_leaflet() returns pre-summarized" , {
52+ skip_on_cran()
4253 p2 <- presence(visits(finches )) %> %
4354 dplyr :: group_by(logger_id , lat , lon ) %> %
4455 dplyr :: summarize(amount = sum(length ) / logger_n [1 ], .groups = " drop" )
@@ -52,6 +63,8 @@ test_that("map_leaflet() returns summary map", {
5263
5364 expect_error(map <- map_leaflet(p = p2 , m = m2 ), NA )
5465 expect_s3_class(map , c(" leaflet" , " htmlwidget" ))
66+
67+ skip_on_os(c(" windows" , " mac" ))
5568 expect_snapshot_value(deparse(map $ x ), style = " json2" )
5669})
5770
@@ -67,7 +80,9 @@ test_that("map_leaflet() returns summary map of individuals", {
6780
6881 expect_error(map <- map_leaflet(p = p_indiv , m = m_indiv ), NA )
6982 expect_s3_class(map , c(" leaflet" , " htmlwidget" ))
70- expect_snapshot_value(deparse(map $ x ), style = " json2" )
83+
84+ skip_on_os(c(" windows" , " mac" ))
85+ expect_snapshot_value(deparse(map $ x ), style = " json2" , variant = )
7186})
7287
7388test_that(" map_leaflet() scale, pal, title" , {
@@ -88,5 +103,7 @@ test_that("map_leaflet() scale, pal, title", {
88103 NA
89104 )
90105 expect_s3_class(map , c(" leaflet" , " htmlwidget" ))
106+
107+ skip_on_os(c(" windows" , " mac" ))
91108 expect_snapshot_value(deparse(map $ x ), style = " json2" )
92109})
0 commit comments