@ -375,4 +375,79 @@ RSpec.describe Form::Question, type: :model do
end
end
end
end
end
end
describe"#error_display_label"do
let(:question_with_error_label_no_punctuation){described_class.new("address_line1_input",{"header"=>"Address line 1","error_label"=>"Address line 1"},page)}
let(:question_with_error_label_with_full_stop){described_class.new("address_line1_input",{"header"=>"Address line 1","error_label"=>"Address line 1."},page)}
let(:question_with_error_label_with_question_mark){described_class.new("address_line1_input",{"header"=>"Address line 1","error_label"=>"Address line 1?"},page)}
let(:question_with_error_label_with_brackets){described_class.new("address_line1_input",{"header"=>"Address line 1","error_label"=>"(Address line 1)"},page)}
let(:question_with_check_answer_label_no_punctuation){described_class.new("address_line1_input",{"header"=>"Address line 1","check_answer_label"=>"Address line 1"},page)}
let(:question_with_check_answer_label_with_full_stop){described_class.new("address_line1_input",{"header"=>"Address line 1","check_answer_label"=>"Address line 1."},page)}
let(:question_with_check_answer_label_with_question_mark){described_class.new("address_line1_input",{"header"=>"Address line 1","check_answer_label"=>"Address line 1?"},page)}
let(:question_with_check_answer_label_with_brackets){described_class.new("address_line1_input",{"header"=>"Address line 1","check_answer_label"=>"(Address line 1)"},page)}
let(:question_with_header_no_punctuation){described_class.new("address_line1_input",{"header"=>"Address line 1"},page)}
let(:question_with_header_with_full_stop){described_class.new("address_line1_input",{"header"=>"Address line 1."},page)}
let(:question_with_header_with_question_mark){described_class.new("address_line1_input",{"header"=>"Address line 1?"},page)}
let(:question_with_header_with_brackets){described_class.new("address_line1_input",{"header"=>"(Address line 1)"},page)}