Skip to content

Commit

Permalink
fixing spec failures after removing featuretoggle
Browse files Browse the repository at this point in the history
  • Loading branch information
pamatyatake2 committed Sep 13, 2023
1 parent 11dd1a7 commit 8d429ee
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 427 deletions.
1 change: 0 additions & 1 deletion app/controllers/intakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def intake_ui_hash
def feature_toggle_ui_hash
{
dateOfBirthField: FeatureToggle.enabled?(:date_of_birth_field, user: current_user),
covidTimelinessExemption: FeatureToggle.enabled?(:covid_timeliness_exemption, user: current_user),
filedByVaGovHlr: FeatureToggle.enabled?(:filed_by_va_gov_hlr, user: current_user),
updatedIntakeForms: FeatureToggle.enabled?(:updated_intake_forms, user: current_user),
eduPreDocketAppeals: FeatureToggle.enabled?(:edu_predocket_appeals, user: current_user),
Expand Down
2 changes: 1 addition & 1 deletion app/models/legacy_appeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def matchable_to_request_issue?(receipt_date)
return false unless issues.any?
return true if active?

covid_flag = FeatureToggle.enabled?(:covid_timeliness_exemption, user: RequestStore.store[:current_user])
covid_flag = false

eligible_for_opt_in?(receipt_date: receipt_date, covid_flag: covid_flag)
end
Expand Down
284 changes: 0 additions & 284 deletions spec/feature/intake/add_issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,36 +371,6 @@ def add_contested_claim_issue
find("label", text: "Yes").click
expect(page).to have_content("Notes")
end

context "with covid_timeliness_exemption feature toggle" do
before { FeatureToggle.enable!(:covid_timeliness_exemption) }
after { FeatureToggle.disable!(:covid_timeliness_exemption) }

context "for higher level review" do
scenario "When the user selects untimely exemption it shows COVID-19 exemption notice" do
start_higher_level_review(veteran)
visit "/intake"
click_intake_continue
expect(page).to have_current_path("/intake/add_issues")

click_intake_add_issue
add_intake_rating_issue("Untimely Issue")
expect(page).to_not have_content("Notes")
expect(page).to have_content("Issue 1 is an Untimely Issue")
find("label", text: "Yes").click
expect(page).to have_content("This request is related to COVID-19")
find('label[for="untimelyExemptionCovid"]').click
safe_click ".add-issue"
expect(page).to have_content("Untimely Issue")
click_on "Establish EP"
expect(page).to have_content("Intake completed")

expect(RequestIssue.all.size).to eq(1)
untimely_issue = RequestIssue.first
expect(untimely_issue.covid_timeliness_exempt).to eq(true)
end
end
end
end

context "show decision date on unidentified issues" do
Expand Down Expand Up @@ -481,9 +451,6 @@ def add_contested_claim_issue

# show untimely modal
expect(page).to have_content("Issue 1 is an Untimely Issue")
add_untimely_exemption_response("Yes")
expect(page).to have_content("I am an exemption note")
click_on "Establish EP"
expect(page).to have_content("Unidentified issue")

untimely_issue = RequestIssue.where(
Expand All @@ -508,14 +475,6 @@ def add_contested_claim_issue
fill_in "Notes", with: "PTSD issue"
safe_click ".add-issue"

# show untimely modal
expect(page).to have_content("Issue 1 is an Untimely Issue")
add_untimely_exemption_response("No")
expect(page).to have_content("Unidentified issue")
click_on "Establish EP"

expect(page).to have_content(RequestIssue::UNIDENTIFIED_ISSUE_MSG)

unidentified_issue = RequestIssue.where(
unidentified_issue_text: "Unidentified issue",
untimely_exemption: false,
Expand All @@ -526,249 +485,6 @@ def add_contested_claim_issue
end
end

context "show untimely issue modal with covid_timeliness_exemption feature toggle" do
before do
FeatureToggle.enable!(:covid_timeliness_exemption)
setup_legacy_opt_in_appeals(veteran.file_number)
end
after { FeatureToggle.disable!(:covid_timeliness_exemption) }
let!(:rating_before_ama) { generate_pre_ama_rating(veteran) }
# let!(:ratings_with_legacy_issues) do
# generate_rating_with_legacy_issues(veteran, receipt_date - 4.days, receipt_date - 4.days)
# end

let(:receipt_date) { Time.zone.today - 30.days }
let(:promulgation_date) { receipt_date - 10.days }
let(:benefit_type) { "compensation" }
let(:untimely_days) { 372.days }
let(:profile_date) { (receipt_date - 8.days).to_datetime }
let(:untimely_promulgation_date) { receipt_date - untimely_days - 1.day }
let(:untimely_profile_date) { receipt_date - untimely_days - 3.days }

let!(:rating) { generate_rating(veteran, promulgation_date, profile_date) }
let!(:untimely_ratings) { generate_untimely_rating(veteran, untimely_promulgation_date, untimely_profile_date) }

let!(:old_ratings) do
Generators::PromulgatedRating.build(
participant_id: veteran.participant_id,
promulgation_date: receipt_date - 372.days,
profile_date: receipt_date - 372.days,
issues: [
{ reference_id: "abc127", decision_text: "Left knee issue granted" },
{ reference_id: "def457", decision_text: "PTSD1 denied" }
]
)
end

context "on a higher level review" do
scenario "when vacols issue is ineligible, but is eligible with an exemption" do
start_higher_level_review(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("osteomyelitis")

# Expect untimely issue modal to show
expect(page).to have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content(
"The legacy issue isn't eligible for SOC/SSOC opt-in unless an exemption has been requested"
)
find("label", text: "No").click
safe_click ".add-issue"

expect(page).to have_content("PTSD denied is ineligible")

click_remove_intake_issue_by_text("PTSD denied")
click_intake_add_issue
add_intake_rating_issue("PTSD denied")
add_intake_rating_issue("osteomyelitis")
find("label", text: "Yes").click
find('label[for="untimelyExemptionCovid"]').click
safe_click ".add-issue"

expect(page).to have_content("Adding this issue will automatically close VACOLS issue")

click_on "Establish EP"
expect(page).to have_content("Intake completed")
end

scenario "when vacols issue ineligible even with an exemption" do
start_higher_level_review(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("typhoid arthritis")
expect(page).to_not have_content("Issue 1 is an Untimely Issue")
end

scenario "when request issue is ineligible" do
start_higher_level_review(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("Left knee issue granted")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("ankylosis of hip")

# Expect untimely issue modal to show
expect(page).to have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content(
"The issue requested isn't usually eligible because its decision date is older than what's allowed"
)
end

scenario "when request and vacols issue are both ineligible" do
start_higher_level_review(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("Left knee issue granted")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("osteomyelitis")

# Expect untimely issue modal to show
expect(page).to have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content(
"its decision date is older than what is allowed, and the legacy issue issue isn't eligible for SOC/SSOC "
)
end

scenario "when request and vacols issue are both eligible" do
start_higher_level_review(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("ankylosis of hip")

# Expect untimely issue modal not to show
expect(page).to_not have_content("Issue 1 is an Untimely Issue")
end
end

context "on a supplemental claim" do
scenario "when vacols issue is ineligible, but eligible with an exemption" do
start_supplemental_claim(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("osteomyelitis")

# Expect untimely issue modal to show
expect(page).to have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content(
"The legacy issue isn't eligible for SOC/SSOC opt-in unless an exemption has been requested"
)
find("label", text: "No").click
safe_click ".add-issue"

expect(page).to have_content("PTSD denied is ineligible")

click_remove_intake_issue_by_text("PTSD denied")
click_intake_add_issue
add_intake_rating_issue("PTSD denied")
add_intake_rating_issue("osteomyelitis")
find("label", text: "Yes").click
find('label[for="untimelyExemptionCovid"]').click
safe_click ".add-issue"

expect(page).to have_content("Adding this issue will automatically close VACOLS issue")

click_on "Establish EP"
expect(page).to have_content("Intake completed")
end

scenario "when vacols issue is ineligible even with an exemption" do
start_supplemental_claim(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("typhoid arthritis")

# Expect untimely issue modal to not show
expect(page).to_not have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content("PTSD denied is ineligible")
end

scenario "when vacols issue is eligible on a supplemental claim" do
start_supplemental_claim(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("ankylosis of hip")

# Expect untimely issue modal to show
expect(page).to_not have_content("Issue 1 is an Untimely Issue")
end
end

context "on an appeal" do
scenario "when request issue is ineligible and no vacols id on appeal" do
start_appeal(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("Left knee issue granted")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
find("label", text: /^No VACOLS issues were found/).click
safe_click ".add-issue"

# Expect untimely issue modal to show
expect(page).to have_content("Issue 1 is an Untimely Issue")
expect(page).to have_content(
"The issue requested isn't usually eligible because its decision date is older than what's allowed"
)
end

scenario "when request issue is eligible and vacols issue added on appeal" do
start_appeal(veteran, legacy_opt_in_approved: true)
visit "/intake/add_issues"
click_intake_add_issue
add_intake_rating_issue("PTSD denied")

# Expect legacy opt in issue modal to show
expect(page).to have_content("Does issue 1 match any of these VACOLS issues?")
add_intake_rating_issue("lumbosacral strain")

# Expect untimely issue modal to show
expect(page).to_not have_content("Issue 1 is an Untimely Issue")
end
end

scenario "checks that attorney categories do not exist on claim reviews" do
start_higher_level_review(veteran_no_ratings)
visit "/intake"
click_intake_continue
expect(page).to have_current_path("/intake/add_issues")

click_intake_add_issue
expect(page).to have_content("Does issue 1 match any of these non-rating issue categories?")
find(".cf-select__control").click
expect(page).to_not have_content("Contested Claims - Attorney fees")
expect(page).to have_content("Active Duty Adjustments")
end
end

context "on an appeal" do
scenario "check that hearing type field is present because docket type is hearing and hearing type is not nil" do
start_appeal(veteran, docket_type: Constants.AMA_DOCKETS.hearing, original_hearing_request_type: "video")
Expand Down
1 change: 0 additions & 1 deletion spec/feature/intake/higher_level_review/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

before do
Timecop.freeze(post_ama_start_date)
FeatureToggle.enable!(:use_ama_activation_date)
end

let(:veteran) do
Expand Down
2 changes: 0 additions & 2 deletions spec/feature/intake/higher_level_review_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@
FeatureToggle.enable!(:filed_by_va_gov_hlr)
FeatureToggle.enable!(:updated_intake_forms)
FeatureToggle.enable!(:hlr_sc_unrecognized_claimants)
FeatureToggle.enable!(:use_ama_activation_date)
end
after do
FeatureToggle.disable!(:filed_by_va_gov_hlr)
FeatureToggle.disable!(:updated_intake_forms)
FeatureToggle.disable!(:hlr_sc_unrecognized_claimants)
FeatureToggle.disable!(:use_ama_activation_date)
end

it "Creates an end product and contentions for it" do
Expand Down
7 changes: 1 addition & 6 deletions spec/feature/intake/intake_edit_confirmation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@
click_intake_add_issue
click_intake_no_matching_issues
add_intake_nonrating_issue(date: (decision_review.receipt_date - 2.years).mdY)
add_untimely_exemption_response("Yes")
click_remove_intake_issue_dropdown("PTSD denied")
click_edit_submit

expect(page).to have_current_path("/#{edit_path}/confirmation")
expect(page).to have_content("A #{decision_review.class.review_title} Rating EP is being canceled")
expect(page).to have_current_path("/#{edit_path}")
expect(page).to_not have_content("Once established in VBMS, you may edit the issues")
end
end
Expand Down
Loading

0 comments on commit 8d429ee

Please sign in to comment.