public function testFilterInReuseForm() { $session =
$this->
getSession();
$page =
$session->
getPage();
$path = 'admin/structure/types/manage/article';
$path2 = 'admin/structure/types/manage/page';
$this->
fieldUIAddNewFieldJS($path, 'horse', 'Horse'
);
$this->
fieldUIAddNewFieldJS($path, 'horseradish', 'Horseradish', 'text'
);
$this->
fieldUIAddNewFieldJS($path, 'carrot', 'Carrot', 'text'
);
$this->
drupalGet($path2 . '/fields'
);
$this->
assertSession()->
linkExists('Re-use an existing field'
);
$this->
clickLink('Re-use an existing field'
);
$this->
assertSession()->
waitForElementVisible('css', '#drupal-modal'
);
$filter =
$this->
assertSession()->
waitForElementVisible('css', 'input[name="search"]'
);
$horse_field_row =
$page->
find('css', '.js-reuse-table tr[data-field-id="field_horse"]'
);
$horseradish_field_row =
$page->
find('css', '.js-reuse-table tr[data-field-id="field_horseradish"]'
);
$carrot_field_row =
$page->
find('css', '.js-reuse-table tr[data-field-id="field_carrot"]'
);
// Confirm every field is visible first.
$this->
assertTrue($horse_field_row->
isVisible());
$this->
assertTrue($horseradish_field_row->
isVisible());
$this->
assertTrue($carrot_field_row->
isVisible());
// Filter by 'horse' field name.