Skip to content

[Bug]:Snapshot failures found during R CMD Check #341

@Andrew-Acker125

Description

@Andrew-Acker125

What happened?

Hello, We've been running R CMD check for packages for our package registry manager PRISM (Home | PRISM) and noticed that teal.widgets is failing during tests. We found the root cause to be newer versions of shiny, as the snapshot test passes when using shiny 1.11.0 an older version.
The full error output:

checking tests Running testthat.R
  Running the tests in tests/testthat.R failed.
  Last 13 lines of output:
    + <button class="btn btn-default action-button teal-widgets-busy-disable button"
    +   id="STH-button" type="button">
    +   <span class="action-label">STH2</span>
    + </button>
    Snapshots
    To review and process snapshots locally:
    * Locate check directory.
    * Copy 'tests/testthat/_snaps' to local package.
    * Run `testthat::snapshot_accept()` to accept all changes.
    * Run `testthat::snapshot_review()` to review all changes.
    [ FAIL 1 | WARN 0 | SKIP 27 | PASS 253 ]
    Error: ! Test failures.
    Execution halted

Here is the failing test:

rtestthat::test_that("snapshot test for verbatim_popup_ui", {
  testthat::skip_if_not_installed("withr")
  withr::local_seed(1)
  testthat::expect_snapshot(verbatim_popup_ui("STH", "STH2"))
})

Expected Snapshot:

html<button class="btn btn-default action-button teal-widgets-busy-disable button"
  id="STH-button" type="button">STH2</button>

Snapshot when tested:

html<button class="btn btn-default action-button teal-widgets-busy-disable button"
  id="STH-button" type="button">
  <span class="action-label">STH2</span>
</button>

Happy to provide any more details or clarity if needed.

sessionInfo()

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions