Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashsinghal committed Oct 11, 2024
1 parent e937781 commit 48d4bfe
Showing 3 changed files with 81 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/id.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
Code
get_link(guide_id())
Output
<a href="https://github.com/user-attachments/files/16909035/Climate_Action_Questionnaire_tilt_online_portal.zip">Download the climate action guide</a>
<a href="">Download the climate action guide</a>

---

8 changes: 8 additions & 0 deletions tests/testthat/_snaps/iframe.new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# fails gracefully

Code
iframe()
Condition
Error in `config::get()`:
! argument "section" is missing, with no default

72 changes: 72 additions & 0 deletions tests/testthat/_snaps/ui-selectChoices.new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# snap

Code
selectChoices("country")
Output
<div class="form-group shiny-input-container">
<label class="control-label" id="country-label" for="country">Country</label>
<div>
<select id="country" class="shiny-input-select"><option value="." selected>.</option>
<option value="austria">austria</option>
<option value="france">france</option>
<option value="germany">germany</option>
<option value="netherlands">netherlands</option>
<option value="spain">spain</option></select>
<script type="application/json" data-for="country" data-nonempty="">{"plugins":["selectize-plugin-a11y"]}</script>
</div>
</div>

# errors gracefully

Code
selectChoices()
Condition
Error in `paste0()`:
! argument "id" is missing, with no default

---

Code
selectChoices("bad")
Condition
Error in `get()`:
! object 'bad_choices' not found

# haven't changed

Code
level_choices()
Output
[1] "product" "company"

---

Code
country_choices()
Output
[1] "." "austria" "france" "germany" "netherlands"
[6] "spain"

---

Code
year_choices()
Output
[1] "." "2030" "2050" "NA"

---

Code
scenario_choices()
Output
[1] "." "NZ 2050" "1.5C RPS" "NA"

---

Code
grouping_emission_choices()
Output
[1] "." "all" "isic_4digit"
[4] "tilt_subsector" "unit" "unit_isic_4digit"
[7] "unit_tilt_subsector" "NA"

0 comments on commit 48d4bfe

Please sign in to comment.