From 065a27a29019c5cbcf77decc521df37215c5c3c1 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Fri, 19 Apr 2024 08:48:34 -0500 Subject: [PATCH] Add a test --- tests/testthat/_snaps/navbar.md | 9 +++------ tests/testthat/test-navbar.R | 8 +++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/testthat/_snaps/navbar.md b/tests/testthat/_snaps/navbar.md index aad22a996..4d5e09094 100644 --- a/tests/testthat/_snaps/navbar.md +++ b/tests/testthat/_snaps/navbar.md @@ -135,16 +135,13 @@ # data_navbar() can re-order default elements Code - data_navbar(pkg) + data_navbar(pkg)[c("left", "right")] Output - $type - [1] "default" - $left - [1] "
  • \n \n \n \n \n
  • \n
  • \n Reference\n
  • " + [1] "
  • \n \n \n \n \n
  • \n
  • \n\n
  • " $right - [1] "
  • \n Changelog\n
  • " + [1] "
  • \n Changelog\n
  • " # data_navbar() can remove elements diff --git a/tests/testthat/test-navbar.R b/tests/testthat/test-navbar.R index 1ee9fe70b..89dd6a405 100644 --- a/tests/testthat/test-navbar.R +++ b/tests/testthat/test-navbar.R @@ -82,18 +82,20 @@ test_that("data_navbar() works by default", { test_that("data_navbar() can re-order default elements", { pkg <- local_pkgdown_site(meta = " + template: + bootstrap: 5 repo: url: home: https://github.com/r-lib/pkgdown/ navbar: structure: - left: [github, reference] - right: news + left: [github, search] + right: [news] ") file.create(file.path(pkg$src_path, "NEWS.md")) - expect_snapshot(data_navbar(pkg)) + expect_snapshot(data_navbar(pkg)[c("left", "right")]) }) test_that("data_navbar() can remove elements", {