You are here

public function InlineEntityFormTest::testGalleryCollapse in Thunder 6.2.x

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()
  2. 8.2 tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()
  3. 8.3 tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()
  4. 8.4 tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()
  5. 6.0.x tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()
  6. 6.1.x tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\InlineEntityFormTest::testGalleryCollapse()

Test saving collapsed gallery paragraph.

Test saving changes in inline entity form using the inline_entity_form_simple widget inside gallery paragraph when the paragraph form is collapsed.

Demo Article (node Id: 7) is used for testing.

File

tests/src/FunctionalJavascript/Integration/InlineEntityFormTest.php, line 28

Class

InlineEntityFormTest
Test for update hook changes.

Namespace

Drupal\Tests\thunder\FunctionalJavascript\Integration

Code

public function testGalleryCollapse() {

  // Test saving inline entity form when collapsing paragraph form.
  $node = $this
    ->loadNodeByUuid('36b2e2b2-3df0-43eb-a282-d792b0999c07');
  $this
    ->drupalGet($node
    ->toUrl('edit-form'));
  $page = $this
    ->getSession()
    ->getPage();

  // Edit gallery paragraph.
  $this
    ->clickButtonCssSelector($page, '[data-drupal-selector="field-paragraphs-0-edit-2"]');
  $this
    ->setFieldValue($page, 'field_paragraphs[0][subform][field_media][0][inline_entity_form][name][0][value]', 'New gallery name before collapse');

  // Collapse parargraph form.
  $this
    ->clickButtonCssSelector($page, '[name="field_paragraphs_0_collapse"]');
  $this
    ->clickSave();

  // Re-open edit form, value has changed.
  $this
    ->drupalGet($node
    ->toUrl('edit-form'));
  $this
    ->assertSession()
    ->pageTextContains('New gallery name before collapse');
}