update signature validation

This commit is contained in:
Alex Turchyn
2025-03-29 13:40:25 +02:00
committed by Pete Matsyburka
parent 7e70f4fb14
commit b0110d9340
9 changed files with 144 additions and 63 deletions
+13
View File
@@ -360,6 +360,19 @@ RSpec.describe 'Signing Form', type: :system do
expect(field_value(submitter, 'Signature')).to be_present
end
it 'shows an error message if the canvas is not drawn or too simple' do
visit submit_form_path(slug: submitter.slug)
find('#expand_form_button').click
page.find('canvas').click([], { x: 150, y: 100 })
alert_text = page.accept_alert do
click_button 'Sign and Complete'
end
expect(alert_text).to eq 'Signature is too small or simple. Please redraw.'
end
it 'completes the form if the canvas is typed' do
visit submit_form_path(slug: submitter.slug)