Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Forms' #states have always needed automated tests.
Let's do it now we have JavascriptTestBase in Core.
Comment | File | Size | Author |
---|---|---|---|
#7 | drupal-test_form_states-2708823-5.patch | 6.48 KB | DuaelFr |
#5 | interdiff.2708823.2.5.txt | 1.72 KB | DuaelFr |
#2 | drupal-test_form_states-2708823-2.patch | 6.31 KB | DuaelFr |
Comments
Comment #2
DuaelFrHere is something to start with.
If you look at
\Drupal\form_test\Form\FormTestStatesForm::$field_types
you'll see a lot of disabled field types with some comments explaining why.Comment #3
DuaelFrComment #4
DuaelFrBEWARE!
The test passed because some field types are not tested. In fact, #states does not work as expected.
You can manually see what happens by enabling the form_test module and go to form-test/states then check the "trigger" checkbox and look at fields above.
Comment #5
DuaelFrVery small progress.
Comment #6
dawehnerSounds like a duplicate of #2702233: [backport] Add JavaScript tests for Form API #states: required, visible, invisible, expanded, checked, unchecked, sorry.
Comment #7
DuaelFrJust for the record, here is my last patch updated to remove all the composer and phpunit related stuff.