-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write feature test to replicate scenario with where user modifies JudgeAssignTask in multiple tabs #16582
Write feature test to replicate scenario with where user modifies JudgeAssignTask in multiple tabs #16582
Conversation
Code Climate has analyzed commit 3561be1 and detected 0 issues on this pull request. View more on Code Climate. |
# below correctly selects the second task action dropdown | ||
find("#currently-active-tasks > div:nth-child(4) > table > tbody > tr:nth-child(3) > td.taskContainerStyling.taskActionsContainerStyling > div > div > div > div > div > div").click | ||
# below - could not successfully select the "assign to attorney" dropdown because there were two dropdowns with this option | ||
click_dropdown(text: "Assign to attorney") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to scope it by specifying the container
(second argument, after the options hash):
assign_task_row = find("#currently-active-tasks > div:nth-child(4) > table > tbody > tr:nth-child(3)")
click_dropdown({text: "Assign to attorney"}, assign_task_row)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like assign_task_row = find("table[summary='layout table'] tr:nth-child(3)")
a bit better.
…ed from virtual to video or central (#16600) Connects [CASEFLOW-1556](https://vajira.max.gov/browse/CASEFLOW-1556) ### Description Read [thread](https://dsva.slack.com/archives/C01MBDKAC7P/p1628282082046700?thread_ts=1628004392.010800&cid=C01MBDKAC7P) on why this only implements the copy changes for when virtual hearing is converted back to Video or Central. - modify email copy and subject when virtual hearing is converted back to video or central ### Acceptance Criteria - [x] When a scheduled hearing is converted from Virtual to Video or Central send an email with the following content to the appellant - [x] Subject: "Your Board hearing will be held at {Hearing Location or RO Name}" - [x] Replace the opening paragraph of the intro section with: "Your hearing with a Veterans Law Judge of the Board of Veterans’ Appeals has changed format. Instead of a virtual tele-hearing, you will go in person to {Hearing Location or RO name} and the Judge will meet with you {via video conference / in person}." - [x] Display the following sections underneath the salutation and intro - [x] Date and Time - [x] Location - [x] What should I expect on the day of my hearing? - [x] Signature - [x] Internal use - [x] When a scheduled hearing is converted from Virtual to Video or Central and a representative email has already been added to the hearing, send an email with the following content to the representative - [x] Subject: "{Full Appellant Name}’s hearing will be held at {Hearing Location or RO Name}" - [x] Replace the opening paragraph of the intro section with: "Your client's hearing with a Veterans Law Judge of the Board of Veterans’ Appeals has changed format. Instead of a virtual tele-hearing, you will go in person to {Hearing Location or RO name} and the Judge will meet with you {via video conference / in person}." - [x] Display the following sections underneath the salutation and intro - [x] Appellant name - [x] Case Details link - [x] Date and Time - [x] Location - [x] Signature - [x] Internal use ### Testing Plan ```bash bundle exec rake emails:hearings:sample Check the content of `cancellation_appellant.rb` and `cancellation_representative.rb` ```
* bug fix * move method call
Connects https://vajira.max.gov/browse/CASEFLOW-1034 ### Description User Story: As a VLJ Support Team user, I want the ability to indicate I want to edit an Appellant's information, so that I may correct any mistakes made during intake. ### Acceptance Criteria - [ ] Code compiles correctly ### Testing Plan 1. Go to ... - [ ] For higher-risk changes: [Deploy the custom branch to UAT to test](https://github.com/department-of-veterans-affairs/appeals-deployment/wiki/Applications---Deploy-Custom-Branch-to-UAT) ### User Facing Changes <img width="1110" alt="Screen Shot 2021-08-10 at 9 34 02 AM" src="https://user-images.githubusercontent.com/23080951/128876347-299003b9-0671-4938-8d84-d4012c75553b.png">
# app currently allows the invalid flow of a JudgeAssignTask going from cancelled to completed | ||
expect(Task.find(first_judge_assign_task_id).status).to eq("completed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# app currently allows the invalid flow of a JudgeAssignTask going from cancelled to completed | |
expect(Task.find(first_judge_assign_task_id).status).to eq("completed") | |
# BUG: app currently allows the invalid flow of a JudgeAssignTask going from cancelled to completed | |
expect(Task.find(first_judge_assign_task_id).status).to eq("completed") |
appeal.reload.treee | ||
|
||
# open a second window and visit case details page, window B | ||
second_window = open_new_window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool and great to see! Very well-described too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job Eileen!
Update: I decided to merge this branch into |
…eDecisionReviewTask (#16586) Resolves jira ticket [Research and prevent recurrence of bug where one case has multiple JudgeAssignTasks, JudgeDecisionReviewTasks, and AttorneyTasks](https://vajira.max.gov/projects/CASEFLOW/issues/CASEFLOW-2075) . Relates to github PR [Write feature test to replicate scenario with multiple Judge/Attorney tasks](#16582). ### Description A bug occurred in production where a user created multiple Judge and Attorney tasks by doing the same actions in two different tabs, as described in [this comment from Yoom](https://github.com/department-of-veterans-affairs/dsva-vacols/issues/212#issuecomment-889401070). The `JudgeAssignTask` [model already had a validation ](#16072) to ensure that an appeal cannot have more than one `JudgeAssignTask` open at the same time. I expanded this validation to the `JudgeDecisionReviewTask` and `AttorneyTask` models. I also refactored the validation to use instance variables instead of thread-local variables, as suggested in [this StackOverflow post](https://stackoverflow.com/questions/8881712/skip-certain-validation-method-in-model) that Yoom linked in a previous thread. ### Acceptance Criteria - [ ] Code compiles correctly - [ ] All automated tests pass - [ ] Task validations no longer use thread-local variables - [ ] If a user attempts to act on the same `JudgeAssignTask` in two different windows, they will not be able to create multiple `JudgeDecisionReviewTask`s and `AttorneyTask`s. ### Testing Plan [ ] Find an appeal with an open `JudgeAssignTask` ``` jat = JudgeAssignTask.open.last appeal = jat.appeal ``` [ ] On local caseflow, switch users to the judge who has the `JudgeAssignTask` assigned to them [ ] Navigate to the case details page for the relevant appeal. Open the same page in a second tab `/queue/appeals/${appeal.uuid}` [ ] In the first tab, reassign the `JudgeAssignTask` to another judge [ ] In the second tab, attempt to complete the `JudgeAssignTask` by assigning the case to an attorney. You should not be able to complete this action
Resolves Multiple Judge/Attorney Tasks.
Description
The purpose of this PR was to replicate the scenario where a user creates multiple Judge and Attorney tasks by doing the same actions in two different tabs, as described in this comment from Yoom. The user's actions cause a
JudgeAssignTask
to change status fromcancelled
tocompleted
, which is an invalid flow.(The below section is no longer relevant because JC and Yoom answered my question, but I am including it for posterity's edification.)
I was unable to completely replicate the scenario, because I couldn't figure out how to select "Assign an attorney" when there were two dropdowns on the page with this option. Here is the error that the test currently throws.I tried to open the test in a local browser and then select the "Assign an attorney" option based on its css selector, which is how I had selected the dropdown itself. However, the dev tools did not display the css selectors for the task action options.... I am unsure why.Guidance on how to select the task option would be appreciated, please!Acceptance Criteria
JudgeAssignTask
to change status fromcancelled
tocompleted
Testing Plan