public function ParagraphsAddModesTest::testNoDefaultValue

Same name in this branch
  1. 8.x-1.x paragraphs/tests/src/Functional/WidgetStable/ParagraphsAddModesTest.php \Drupal\Tests\paragraphs\Functional\WidgetStable\ParagraphsAddModesTest::testNoDefaultValue()
  2. 8.x-1.x paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsAddModesTest.php \Drupal\Tests\paragraphs\Functional\WidgetLegacy\ParagraphsAddModesTest::testNoDefaultValue()

Tests that paragraphs field does not allow default values.

File

paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsAddModesTest.php, line 17

Class

ParagraphsAddModesTest
Tests paragraphs add modes.

Namespace

Drupal\Tests\paragraphs\Functional\WidgetLegacy

Code

public function testNoDefaultValue() {
  $this
    ->loginAsAdmin();
  $this
    ->addParagraphedContentType('paragraphed_test', 'paragraphs_field', 'entity_reference_paragraphs');

  // Edit the field.
  $this
    ->drupalGet('admin/structure/types/manage/paragraphed_test/fields');
  $this
    ->clickLink('Edit');

  // Check that the current field does not allow to add default values.
  $this
    ->assertSession()
    ->pageTextContains('No widget available for: paragraphs_field.');
  $this
    ->submitForm([], 'Save settings');
  $this
    ->assertSession()
    ->pageTextContains('Saved paragraphs_field configuration.');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}