Problem/Motivation

Forms' #states have always needed automated tests.
Let's do it now we have JavascriptTestBase in Core.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DuaelFr created an issue. See original summary.

DuaelFr’s picture

Here 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.

DuaelFr’s picture

Status: Active » Needs review
DuaelFr’s picture

Status: Needs review » Needs work

BEWARE!
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.

DuaelFr’s picture

Very small progress.

dawehner’s picture

DuaelFr’s picture

FileSize
6.48 KB

Just for the record, here is my last patch updated to remove all the composer and phpunit related stuff.