# Comprehensive tests for save_html() function
# Testing file creation based on real example usage patterns
# ==============================================================================
# ggplot2 File Creation Tests
# ==============================================================================
test_that("save_html() creates HTML file for ggplot2 bar plot", {
testthat::skip_if_not_installed("ggplot2")
p <- create_test_ggplot_bar()
tmp_file <- tempfile(fileext = ".html")
result <- save_html(p, file = tmp_file)
testthat::expect_true(file.exists(tmp_file))
testthat::expect_equal(result, tmp_file)
# Verify content
content <- readLines(tmp_file)
testthat::expect_true(any(grepl("