Skip to content

Commit

Permalink
Calvin/appeals 30829 assignment spec (#19555)
Browse files Browse the repository at this point in the history
* fixed most issues

* fixed last two errors

---------

Co-authored-by: cacevesva <109166981+cacevesva@users.noreply.github.com>
  • Loading branch information
calvincostaBAH and cacevesva authored Sep 22, 2023
1 parent ea99594 commit b659eca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/app/queue/components/AssignToAttorneyWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class AssignToAttorneyWidget extends React.PureComponent {
return this.props.showSuccessMessage({
title: sprintf(COPY.ASSIGN_WIDGET_SUCCESS, {
verb: isReassign ? 'You have successfully reassigned' : 'You have successfully assigned',
numCases: selectedTasks.length === 1 && selectedTasks[0].appeal ? `${selectedTasks[0].appeal.appellantFullName}'s` : selectedTasks.length,
numCases: selectedTasks.length === 1 && selectedTasks[0].appeal?.appelantFullName ? `${selectedTasks[0].appeal.appellantFullName}'s` : selectedTasks.length,
casePlural: pluralize('cases', selectedTasks.length),
// eslint-disable-next-line camelcase
assignee: assignee.full_name
Expand Down
26 changes: 15 additions & 11 deletions spec/feature/queue/judge_assignment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
click_dropdown(text: attorney_one.full_name)

click_on "Assign 2 cases"
expect(page).to have_content("Assigned 2 tasks to #{attorney_one.full_name}")
expect(page).to have_content("You have successfully assigned 2 cases to #{attorney_one.full_name}")
end

step "navigates to the attorney's case list" do
Expand All @@ -92,7 +92,7 @@
click_dropdown(text: attorney_two.full_name)

click_on "Assign 1 case"
expect(page).to have_content("Reassigned 1 task to #{attorney_two.full_name}")
expect(page).to have_content("You have successfully reassigned 1 case to #{attorney_two.full_name}")
end

step "navigates to the other attorney's case list" do
Expand Down Expand Up @@ -256,12 +256,14 @@
click_on("#{appeal.veteran_first_name} #{appeal.veteran_last_name}")

click_dropdown(text: Constants.TASK_ACTIONS.REASSIGN_TO_JUDGE.label)
click_dropdown(prompt: "Select a user", text: judge_two.full_name)
within all(".cf-select")[1] do
click_dropdown(prompt: "Select", text: judge_two.full_name)
end
fill_in("taskInstructions", with: "Test")
appeal.reload.tasks.update_all(status: Constants.TASK_STATUSES.cancelled)
click_on("Assign")

expect(page).to have_content("Task reassigned to #{judge_two.full_name}")
expect(page).to have_content("You have successfully assigned #{appeal.veteran_first_name} #{appeal.veteran_last_name}’s case to #{judge_two.full_name}")

click_on("Switch views")
click_on(format(COPY::JUDGE_ASSIGN_DROPDOWN_LINK_LABEL, judge_one.css_id))
Expand All @@ -287,9 +289,9 @@
click_dropdown(text: Constants.TASK_ACTIONS.ASSIGN_TO_ATTORNEY.label)
click_dropdown(prompt: "Select a user", text: attorney_one.full_name)
fill_in(COPY::ADD_COLOCATED_TASK_INSTRUCTIONS_LABEL, with: "note")
click_on("Submit")
click_on("Assign")

expect(page).to have_content("Assigned 1 task to #{attorney_one.full_name}")
expect(page).to have_content("You have successfully assigned 1 case to #{attorney_one.full_name}")
end
end

Expand All @@ -304,7 +306,9 @@
click_on("#{appeal_one.veteran_first_name} #{appeal_one.veteran_last_name}")

click_dropdown(text: Constants.TASK_ACTIONS.REASSIGN_TO_LEGACY_JUDGE.label)
click_dropdown(prompt: "Select a user", text: judge_two.full_name)
within all(".cf-select")[1] do
click_dropdown(prompt: "Select", text: judge_two.full_name)
end
fill_in("taskInstructions", with: "Test")
click_on("Assign")

Expand Down Expand Up @@ -337,8 +341,8 @@
click_dropdown({ text: judge_two.full_name }, page.find(".dropdown-Other"))
fill_in(COPY::ADD_COLOCATED_TASK_INSTRUCTIONS_LABEL, with: "note")

click_on("Submit")
expect(page).to have_content("Assigned 1 task to #{judge_two.full_name}")
click_on("Assign")
expect(page).to have_content("You have successfully assigned 1 case to #{judge_two.full_name}")
end
end

Expand All @@ -354,8 +358,8 @@
click_dropdown(prompt: "Select a user", text: judge_one.full_name)
fill_in(COPY::ADD_COLOCATED_TASK_INSTRUCTIONS_LABEL, with: "note")

click_on("Submit")
expect(page).to have_content("Assigned 1 task to #{judge_one.full_name}")
click_on("Assign")
expect(page).to have_content("You have successfully assigned 1 case to #{judge_one.full_name}")
end
end

Expand Down

0 comments on commit b659eca

Please sign in to comment.