Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# f1dataR (development version)

* Fixed a data conversion issue in `time_to_sec()` (#290)
* Updated testing to comply with changes in ggplot2 (#292)

# f1dataR 2.0.1

Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-plot_fastest.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ test_that("graphics work", {
qualiplot <- plot_fastest(2023, 1, "Q", "HAM", "gear")
})
})
expect_equal(gear$label$title, speed$label$title)
expect_equal(gear$label$caption, "Generated by {f1dataR} package")
expect_true(grepl("Lewis Hamilton Fastest Lap", gear$label$subtitle))
expect_equal(ggplot2::get_labs(gear)$title, ggplot2::get_labs(speed)$title)
expect_equal(ggplot2::get_labs(gear)$caption, "Generated by {f1dataR} package")
expect_true(grepl("Lewis Hamilton Fastest Lap", ggplot2::get_labs(gear)$subtitle))

expect_equal(qualiplot$label$title, "2023 Bahrain Grand Prix Qualifying")
expect_equal(ggplot2::get_labs(qualiplot)$title, "2023 Bahrain Grand Prix Qualifying")

qp_axis <- qualiplot + theme_dark_f1(axis_marks = TRUE)

expect_equal(qp_axis$labels, qualiplot$labels)
expect_equal(ggplot2::get_labs(qp_axis), ggplot2::get_labs(qualiplot))
})

test_that("correct_track_ratio works", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test_that("utility functions work", {
# get_jolpica_content() is inherently tested in load_x functions too
url <- "2022/circuits.json?limit=40"

expect_warning(get_ergast_content(url), regexp = "was deprecated in f1dataR")
suppressWarnings(expect_warning(get_ergast_content(url), regexp = "was deprecated in f1dataR"))
# Test for ergast deprecation

# Test add_col_if_absent()
Expand Down
Loading