Skip to content

Commit 85470ca

Browse files
committed
update tests
1 parent b53fd11 commit 85470ca

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

tests/testthat/test-gt_pct_bar.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ test_that("gt_pct_bar SVG is created and has specific palette", {
9999

100100
expect_equal(
101101
round(bar_vals, 2),
102-
c(0.00, 0, 119.06, 0.00, 0, 124.02, 0.00, 0, 85.04, 0.00, 0, 85.04)
102+
c(0.00, 119.06, 0.00, 124.02, 0.00, 85.04, 0.00, 85.04)
103103
)
104104
expect_equal(
105105
bar_colors,
106106
c(
107-
"FF4343;",
107+
#"FF4343;",
108108
"BFBFBF;",
109-
"FF4343;",
109+
#"FF4343;",
110110
"BFBFBF;",
111-
"FF4343;",
111+
#"FF4343;",
112112
"BFBFBF;",
113-
"FF4343;",
113+
#"FF4343;",
114114
"BFBFBF;"
115115
)
116116
)

tests/testthat/test-gt_plt_bar.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ test_that("gt_plt_bar svg is created and has specific values", {
3535
# SVG has specific points ----
3636

3737
bar_vals <- bar_tbl %>%
38-
rvest::html_nodes("svg > g > g > rect:nth-child(2)") %>%
38+
rvest::html_nodes("svg > g > g > rect") %>%
3939
rvest::html_attr("width")
4040

4141
bar_neg_vals <- bar_tbl_neg %>%
42-
rvest::html_nodes("svg > g > g > rect:nth-child(2)") %>%
42+
rvest::html_nodes("svg > g > g > rect") %>%
4343
rvest::html_attr("width")
4444

4545
expect_equal(

tests/testthat/test_test-gt_pct_bar.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ test_that("gt_pct_bar SVG structure, positions, and default palette are correct"
7171
) %>%
7272
rvest::html_attr("style")
7373

74-
# There should be 4 rows * 2 segments
75-
expect_length(bar_x, 8L)
76-
expect_length(styles, 8L)
74+
# There should be 4 rows
75+
expect_length(bar_x, 4L)
76+
expect_length(styles, 4L)
7777
})
7878

7979
test_that("gt_pct_bar respects a custom two-color palette", {
@@ -147,5 +147,5 @@ test_that("gt_pct_bar respects a custom two-color palette", {
147147
rvest::html_attr("style")
148148

149149
cols <- normalize_colors(styles)
150-
expect_length(cols, 8L)
150+
expect_length(cols, 4L)
151151
})

0 commit comments

Comments
 (0)