You are here

public function InlineEntityFormTest::testVideoCollapse in Thunder 8.2

Test saving collapsed video paragraph.

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

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

File

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

Class

InlineEntityFormTest
Test for update hook changes.

Namespace

Drupal\Tests\thunder\FunctionalJavascript\Integration

Code

public function testVideoCollapse() {

  // Test saving inline entity form when collapsing paragraph form.
  $this
    ->drupalGet("node/7/edit");
  $page = $this
    ->getSession()
    ->getPage();

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

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

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