public function SoftLengthLimitJavascriptTest::testSoftLengthLimitWithStyleSelect in Soft Length Limit 8
Tests that the soft length limit widget works.
File
- tests/
src/ FunctionalJavascript/ SoftLengthLimitJavascriptTest.php, line 31
Class
- SoftLengthLimitJavascriptTest
- Tests soft length limit JavaScript behavior for text fields.
Namespace
Drupal\Tests\soft_length_limit\FunctionalJavascriptCode
public function testSoftLengthLimitWithStyleSelect() {
$this
->setupContentType();
$entity = EntityTest::create([
'type' => 'entity_test',
'name' => 'Test Soft Length Limit.',
]);
$entity
->save();
$admin = $this
->drupalCreateUser([
'administer entity_test content',
]);
$this
->drupalLogin($admin);
$this
->drupalGet($entity
->toUrl('edit-form'));
$page = $this
->getSession()
->getPage();
$foo_field = $page
->findField('Foo');
$foo_field
->focus();
$foo_field
->setValue('text');
$tooltip_text = $page
->find('css', '.soft-length-limit-tooltip')
->getText();
$foo_field
->focus();
$this
->assertEquals('4/20', $tooltip_text);
}