Skip to content

Commit

Permalink
Merge pull request #19220 from department-of-veterans-affairs/dev-sup…
Browse files Browse the repository at this point in the history
…port/flaky-test-updates

Dev support/flaky test updates
  • Loading branch information
craigrva authored Aug 22, 2023
2 parents 6812eb5 + ea346a2 commit d753fe1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 154 deletions.
12 changes: 10 additions & 2 deletions spec/feature/dispatch/establish_claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
end

visit "/dispatch/work-assignments"

expect(page).to have_content("1.\nJanet Smith\n0 0 1 1 3")
expect(page).to have_content("2.\nJune Smith\n1 0 0 1 2")
expect(page).to have_content("3.\nJeffers Smith\n0 1 0 1 2")
Expand Down Expand Up @@ -544,6 +545,7 @@
click_label("confirmNote")
click_on "Finish routing claim"

expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")
expect(page).to have_content("Reviewed Full Grant decision")
expect(page).to have_content("Established EP: 070BVAGR - BVA Grant (070) for Station 351 - Muskogee")
Expand Down Expand Up @@ -579,6 +581,7 @@
click_on "Finish routing claim"

# Confirmation Page
expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")
expect(page).to have_content("Added VBMS Note on Rice Compliance")

Expand Down Expand Up @@ -623,16 +626,17 @@
)
end

scenario "Assigning it to complete the claims establishment", skip: "flakey hang" do
scenario "Assigning it to complete the claims establishment" do
visit "/dispatch/establish-claim"
click_on "Establish next claim"

click_on "Route claim"
expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Route Claim")
expect(page).to have_selector(:link_or_button, "Assign to Claim")
click_on "Assign to Claim" # unknown reason sometimes hangs here
click_on "Assign to Claim"

expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")

expect(task.reload.outgoing_reference_id).to eq(end_product.claim_id)
Expand Down Expand Up @@ -671,6 +675,7 @@
click_on "Create End Product"

# Confirmation Page
expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")
expect(page).to have_content("Established EP: 070RMBVAGARC - ARC Remand with BVA Grant for Station 397 - ARC")
expect(page).to have_content("VACOLS Updated: Changed Location to 98")
Expand Down Expand Up @@ -768,6 +773,7 @@

safe_click "#button-Finish-routing-claim"

expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")
expect(page).to have_content("VACOLS Updated: Changed Location to 50")
expect(page).to have_content("Added VBMS Note on Rice Compliance")
Expand Down Expand Up @@ -824,6 +830,7 @@

click_on "Finish routing claim"

expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")
expect(task.reload.completion_status).to eq("special_issue_vacols_routed")
end
Expand Down Expand Up @@ -855,6 +862,7 @@
click_on "Create new EP"
click_on "Create End Product"

expect(page).to have_current_path("/dispatch/establish-claim/#{task.id}")
expect(page).to have_content("Success!")

expect(Fakes::VBMSService).to have_received(:establish_claim!).with(
Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions spec/models/docket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,11 @@
end

it "sets the case ids when a redistribution occurs" do
distributed_case.id
ymd = Time.zone.today.strftime("%F")
result = subject

expect(DistributedCase.find(distributed_case.id).case_id).to eq("#{distributed_appeal.uuid}-redistributed-#{ymd}")
expect(result[0].case_id).to eq(distributed_appeal.uuid)
expect(result.any? { |item| item.case_id == distributed_appeal.uuid }).to be_truthy
end
end

Expand Down
8 changes: 7 additions & 1 deletion spec/models/idt/token_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

let(:css_id) { "TEST_ID" }
let(:key_token_pair) { Idt::Token.generate_one_time_key_and_proposed_token }

# rubocop:disable Metrics/LineLength
let(:invalid_token) { "9373a256a2ac3c3bd320adeeb8a1e4d996ef064d1332357954410f25740bf0c17b6565e152760c461a85587e6a6845457f955ccfa20a8e462a77b776eb10b72c" }
# rubocop:enable Metrics/LineLength
Expand Down Expand Up @@ -50,7 +51,12 @@
expect(Idt::Token.active?(invalid_token)).to eq(false)
end

xit "returns false after a token expires" do
it "returns false after a token expires" do
key, token = key_token_pair
Idt::Token.activate_proposed_token(key, css_id)
expect(Idt::Token.active?(token)).to eq(true)
Idt::Token.client.expire("valid_tokens_key" + token, -1)
expect(Idt::Token.active?(token)).to eq(false)
end
end
end

0 comments on commit d753fe1

Please sign in to comment.