Skip to content

Commit

Permalink
Prune
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed May 13, 2024
1 parent d25901d commit 6289cd9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/testthat/test-sector_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,7 @@ test_that("at company level, two matched and one unmatched products yield `value
expect_equal(sort(other), c(0, 0, 2 / 3))
})

test_that("at product level, when `companies$tilt_sector` doesn't match `scenarios$sector` then `product$grouped_by` is `NA`", {
# This is what I think an analyst would say:
# > A product's tilt_sector with unmatched scenarios's sector yields a "missing benchmark"
#
# Translation to tiltIndicator's code:
# * given: the value "b" of `companies$clustered`
# * when: the corresponding value of `companies$tilt_sector` doesn't match any value of `scenarios$sector`
# * then: the result at product level has the value `NA` in `product$grouped_by`

test_that("at product level, when `companies$sector` doesn't match `scenarios$sector` then `product$grouped_by` is `NA`", {
# Based on this GoogleSheet row:
# https://docs.google.com/spreadsheets/d/16u9WNtVY-yDsq6kHANK3dyYGXTbNQ_Bn/edit#gid=156243064&range=A5:I5
# styler: off
Expand All @@ -155,7 +147,7 @@ test_that("at product level, when `companies$tilt_sector` doesn't match `scenari
expect_true(is.na(product$grouped_by))
})

test_that("at product level, when `companies$tilt_sector` doesn't match `scenarios$sector` then `product$risk_category` and `product$profile_ranking` are `NA`", {
test_that("at product level, when `companies$sector` doesn't match `scenarios$sector` then `product$risk_category` and `product$profile_ranking` are `NA`", {
# TODO: DRY with the test above
# styler: off
companies <- tribble(
Expand Down

0 comments on commit 6289cd9

Please sign in to comment.