diff --git a/tests/testthat/test-module_teal_lockfile.R b/tests/testthat/test-module_teal_lockfile.R new file mode 100644 index 0000000000..fc16d0a9ae --- /dev/null +++ b/tests/testthat/test-module_teal_lockfile.R @@ -0,0 +1,270 @@ +testthat::describe("ui_teal_lockfile", { + testthat::it("returns a shiny tagList", { + result <- ui_teal_lockfile("test_id") + testthat::expect_s3_class(result, "shiny.tag.list") + }) + + testthat::it("creates namespaced elements with correct IDs", { + result <- ui_teal_lockfile("test_id") + result_html <- as.character(result) + testthat::expect_true(grepl("test_id-lockFileStatus", result_html)) + testthat::expect_true(grepl("test_id-lockFileLink", result_html)) + }) + + testthat::it("creates disabled download link", { + result <- ui_teal_lockfile("test_id") + result_html <- as.character(result) + testthat::expect_true(grepl("disabled", result_html)) + }) + + testthat::it("creates elements with correct structure", { + result <- ui_teal_lockfile("test_id") + testthat::expect_length(result, 2) + # First element should be a span tag + testthat::expect_true(grepl("