expect_snapshot for UI functions

  • If your test is in tests/testthat/test-slider.R, it will save the output in tests/testhat/_snaps/slider.md
# sliderInput01() creates expected HTML

    Code
      sliderInput01("x")
    Output
      <div class="form-group shiny-input-container">
        <label class="control-label" id="x-label" for="x">x</label>
        <input class="js-range-slider" id="x" data-skin="shiny" data-min="0" data-max="1" data-from="0.5" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-keyboard="true" data-data-type="number"/>
      </div>
  • If it’s a deliberate change, update the snapshot by running testthat::snapshot_accept().