diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..583b29c9c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +**What changes are proposed in this pull request?** +_Put in a format suitable to be copied into `NEWS.md`, e.g. '* I made an update. (#23)'_ + + +**If there is an GitHub issue associated with this pull request, please provide link.** +_For example, 'closes #23'_ + + +-------------------------------------------------------------------------------- + +Reviewer Checklist (if item does not apply, mark is as complete) + +- [ ] Ensure all package dependencies are installed: `devtools::install_dev_deps()` +- [ ] PR branch has pulled the most recent updates from master branch: `usethis::pr_merge_main()` +- [ ] If a bug was fixed, a unit test was added. +- [ ] Run `pkgdown::build_site()`. Check the R console for errors, and review the rendered website. +- [ ] Code coverage is suitable for any new functions/features: `devtools::test_coverage()` +- [ ] `usethis::use_spell_check()` runs with no spelling errors in documentation + +When the branch is ready to be merged into master: +- [ ] Update `NEWS.md` with the changes from this pull request under the heading "`# cards (development version)`". If there is an issue associated with the pull request, reference it in parentheses at the end update (see `NEWS.md` for examples). +- [ ] Increment the version number using `usethis::use_version(which = "dev")` +- [ ] Run `usethis::use_spell_check()` again +- [ ] Approve Pull Request +- [ ] Merge the PR. Please use "Squash and merge". diff --git a/tests/testthat/test-ard_categorical.R b/tests/testthat/test-ard_categorical.R index 30075134a..ae979895b 100644 --- a/tests/testthat/test-ard_categorical.R +++ b/tests/testthat/test-ard_categorical.R @@ -34,6 +34,20 @@ test_that("ard_categorical() univariate", { ), dplyr::tibble() ) + + # works for ordered factors + expect_equal( + ard_categorical( + mtcars |> dplyr::mutate(cyl = factor(cyl, ordered = TRUE)), + variables = cyl + ) |> + dplyr::select(stat_name, stat_label, statistic), + ard_categorical( + mtcars |> dplyr::mutate(cyl = factor(cyl, ordered = FALSE)), + variables = cyl + ) |> + dplyr::select(stat_name, stat_label, statistic) + ) }) test_that("ard_categorical() univariate & specified denomiator", {