Manage focus on form show/hide

This commit is contained in:
2024-01-05 21:07:12 +01:00
parent 32b8daf29d
commit d28ef26dc5
3 changed files with 12 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ class UnitsTest < ApplicationSystemTestCase
assert_no_selector :link_or_button, text: t('units.index.add_unit')
within first('tbody > tr') do
assert_selector ':focus'
fill_in 'unit[symbol]', with: SecureRandom.random_symbol(rand(1..10))
fill_in 'unit[name]', with: [nil, SecureRandom.alphanumeric(rand(1..500))].sample
assert_difference ->{ Unit.count }, 1 do