Skip to content

Commit

Permalink
button fix for the return to attorney assign task modal scenario 7 (#…
Browse files Browse the repository at this point in the history
…19297)

* button fix for the return to attorney assign task modal scenario 7

* fixing rspecs

* fixing rspecs

---------

Co-authored-by: cacevesva <[email protected]>
  • Loading branch information
vinner57 and cacevesva authored Sep 1, 2023
1 parent a43f282 commit 7e9ef7d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion client/app/queue/AssignToView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ class AssignToView extends React.Component {

const action = getAction(this.props);
const actionData = taskActionData(this.props);
actionData.drop_down_label = COPY.JUDGE_LEGACY_DECISION_REVIEW_TITLE
const isPulacCerullo = action && action.label === 'Pulac-Cerullo';

if (!task || task.availableActions.length === 0) {
Expand All @@ -354,6 +355,7 @@ class AssignToView extends React.Component {
submit: this.submit,
submitButtonClassNames: ['usa-button'],
submitDisabled: !this.validateForm(),
button: 'Assign',
validateForm: isPulacCerullo ?
() => {
return true;
Expand All @@ -362,7 +364,6 @@ class AssignToView extends React.Component {
};

if (task.type === 'JudgeLegacyDecisionReviewTask') {
modalProps.button = 'Assign';
modalProps.submitButtonClassNames = ['usa-button', 'usa-button-hover', 'usa-button-warning'];
modalProps.submitDisabled = this.state.modalDisableButton;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def format_hearing_day(hearing_day, detail_label = nil, total_slots = 0)
click_dropdown(text: Constants.TASK_ACTIONS.ASSIGN_TO_PERSON.to_h[:label])
end

click_on "Submit"
click_on "Assign"

# Your queue
visit "/queue"
Expand All @@ -573,7 +573,7 @@ def format_hearing_day(hearing_day, detail_label = nil, total_slots = 0)

click_dropdown({ text: other_user.full_name }, find(".cf-modal-body"))
fill_in COPY::ADD_COLOCATED_TASK_INSTRUCTIONS_LABEL, with: "Reassign"
click_on "Submit"
click_on "Assign"

# Case should exist in other users' queue
User.authenticate!(user: other_user)
Expand Down Expand Up @@ -605,7 +605,7 @@ def format_hearing_day(hearing_day, detail_label = nil, total_slots = 0)
expect(page).to have_content("You have assigned an administrative action")

click_dropdown(text: Constants.TASK_ACTIONS.ASSIGN_TO_PERSON.to_h[:label])
click_on "Submit"
click_on "Assign"

# Your queue
visit "/queue"
Expand Down
4 changes: 2 additions & 2 deletions spec/feature/queue/ama_queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def judge_assign_to_attorney
expect(dropdown_selected_value(find(".cf-modal-body"))).to eq attorney_user.full_name
fill_in "taskInstructions", with: "Please fix this"

click_on "Submit"
click_on "Assign"

expect(page).to have_content("Task assigned to #{attorney_user.full_name}")
end
Expand Down Expand Up @@ -672,7 +672,7 @@ def judge_assign_to_attorney
expect(dropdown_selected_value(find(".cf-modal-body"))).to eq attorney_user.full_name
fill_in "taskInstructions", with: "Please fix this"

click_on "Submit"
click_on "Assign"

expect(page).to have_content("Task assigned to #{attorney_user.full_name}")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/cavc_task_queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@

click_dropdown(text: Constants.TASK_ACTIONS.SEND_TO_TRANSLATION_BLOCKING_DISTRIBUTION.label)
fill_in "taskInstructions", with: "Please translate the documents in spanish"
click_on "Submit"
click_on "Assign"
expect(page).to have_content COPY::ASSIGN_TASK_SUCCESS_MESSAGE % Translation.singleton.name
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/mail_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
text = Constants.TASK_ACTIONS.ASSIGN_TO_PERSON.label
click_dropdown(prompt: prompt, text: text)
fill_in("taskInstructions", with: "instructions")
click_button("Submit")
click_button("Assign")

expect(page).to have_content(format(COPY::ASSIGN_TASK_SUCCESS_MESSAGE, user.full_name))
expect(page.current_path).to eq("/queue")
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/motion_to_vacate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
find("div", class: "cf-select__option", text: "Assign to person").click
find(".cf-modal .cf-select__control").click
find("div", class: "cf-select__option", text: "Motions attorney").click
click_button(text: "Submit")
click_button(text: "Assign")
expect(page).to have_content("Task assigned to Motions attorney")
motions_attorney_task = VacateMotionMailTask.find_by(assigned_to: motions_attorney)
expect(motions_attorney_task).to_not be_nil
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/privacy_team_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# Assignee dropdown selector should be hidden.
expect(find_all(".cf-modal-body .cf-select__control").count).to eq(0)
fill_in("taskInstructions", with: instructions_text)
find("button", text: "Submit").click
find("button", text: "Assign").click

expect(page).to have_content("Task assigned to #{PrivacyTeam.singleton.name}")

Expand Down
4 changes: 2 additions & 2 deletions spec/feature/queue/quality_review_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
find("div", class: "cf-select__option", text: Constants.TASK_ACTIONS.ASSIGN_TO_PERSON.to_h[:label]).click

fill_in "taskInstructions", with: "Review the quality"
click_on "Submit"
click_on "Assign"

expect(page).to have_content("Task assigned to #{qr_user_name}")

Expand All @@ -101,7 +101,7 @@
expect(dropdown_selected_value(find(".cf-modal-body"))).to eq judge_user.full_name
fill_in "taskInstructions", with: qr_instructions

click_on "Submit"
click_on "Assign"

expect(page).to have_content("On hold (1)")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/feature/queue/task_queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def validate_pulac_cerullo_tasks_created(task_class, label)
expect(dropdown_selected_value(find(".cf-modal-body"))).to eq attorney_user.full_name
fill_in "taskInstructions", with: "Please fix this"

click_on COPY::MODAL_SUBMIT_BUTTON
click_on COPY::MODAL_ASSIGN_BUTTON

expect(page).to have_content(COPY::ASSIGN_TASK_SUCCESS_MESSAGE % attorney_user.full_name)

Expand Down

0 comments on commit 7e9ef7d

Please sign in to comment.