Skip to content

Commit

Permalink
Update HMIS system tests for new Table Action Column pattern (#5039)
Browse files Browse the repository at this point in the history
  • Loading branch information
martha authored Feb 6, 2025
1 parent 761b8fb commit cf61a7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
sign_in(hmis_user)

visit "/client/#{c1.id}/enrollments/#{e1.id}/assessments"
click_link 'Intake'
click_link 'Finish Intake'
end

def select_member(client)
Expand Down
10 changes: 5 additions & 5 deletions drivers/hmis/spec/system/hmis/bulk_services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require_relative '../../requests/hmis/login_and_permissions'
require_relative '../../support/hmis_base_setup'

RSpec.feature 'Hmis Form behavior', type: :system do
RSpec.feature 'Bulk Services behavior', type: :system do
include_context 'hmis base setup'
include_context 'hmis service setup'

Expand Down Expand Up @@ -54,18 +54,18 @@
# Find the indices of the two columns we want to check
header_cells = all('thead th')
last_bed_night_date_index = header_cells.find_index { |cell| cell.text == 'Last Bed Night Date' }
assign_bed_night_index = header_cells.find_index { |cell| cell.text == "Assign Bed Night for #{bed_night_date.strftime('%m/%d/%Y')}" }
button_column_index = header_cells.find_index { |cell| cell.text == 'Actions' }
expect(last_bed_night_date_index).not_to be_nil
expect(assign_bed_night_index).not_to be_nil
expect(button_column_index).not_to be_nil

# Verify that all 3 rows have the expected attributes
all('tbody tr').each do |row|
# Check the "Last Bed Night Date" column
last_bed_night_date = row.all('td')[last_bed_night_date_index].text
expect(last_bed_night_date).to match(/#{bed_night_date.strftime('%m/%d/%Y')}/)

# Check the "Assign Bed Night for mm/dd/yyyy" column
assign_button = row.all('td')[assign_bed_night_index].find('button')
# Check the "Actions" column
assign_button = row.all('td')[button_column_index].first('button')
expect(assign_button.text).to eq('Assigned')
end

Expand Down
2 changes: 1 addition & 1 deletion drivers/hmis/spec/system/hmis/intake_assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
require_relative '../../requests/hmis/login_and_permissions'
require_relative '../../support/hmis_base_setup'

RSpec.feature 'Enrollment/household management', type: :system do
RSpec.feature 'Intake assessment', type: :system do
include_context 'hmis base setup'
# could parse CAPYBARA_APP_HOST
let!(:ds1) { create(:hmis_data_source, hmis: 'localhost') }
Expand Down

0 comments on commit cf61a7b

Please sign in to comment.