Skip to content

Commit

Permalink
Refine test descriptions for flowcell type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrine33 committed Oct 29, 2024
1 parent 021c1ef commit a7f81c8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/features/assets/asset_submission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
let(:original_request_type) { request_types.first }
let(:selected_request_type) { original_request_type }
let(:selected_read_length) { '76' }
let(:request_flowcell_type_validators) do
let(:request_flowcell_type_validator) do
RequestType::Validator.create(
request_type: selected_request_type,
request_option: 'requested_flowcell_type',
Expand Down Expand Up @@ -51,19 +51,21 @@
end
end

describe 'Validation of Flowcell Type field for illumina-HTP NovaSeq requests' do
describe 'Validation of Flowcell Type field for request types that require a Flowcell Type' do
let(:user) { create(:admin) }

# Mock the validator for the selected request type to return the predefined flowcell type validator
# the predefined flowcell type validator require a specific flowcell type to be selected
before do
allow(selected_request_type).to receive(:validator_for).with('requested_flowcell_type').and_return(
request_flowcell_type_validators
request_flowcell_type_validator
)
login_user user
visit labware_path(asset)
click_link 'Request additional sequencing'
end

it 'displays an error if request type is of type illumina_htp_novaseq and Flowcell Type is not set' do
it 'displays an error if Flowcell Type is not set' do
select(selected_request_type.name, from: 'Request type')
select(study.name, from: 'Study')
select(project.name, from: 'Project')
Expand Down Expand Up @@ -102,7 +104,7 @@
end
end

describe 'Validation of Flowcell Type field for no illumina-HTP NovaSeq request types' do
describe 'Validation of Flowcell Type field for request types that do not require a Flowcell Type' do
let(:user) { create(:admin) }

before do
Expand Down

0 comments on commit a7f81c8

Please sign in to comment.