You are here

public function ParagraphsAddModesTest::testEmptyAllowedTypes in Paragraphs 8

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

Tests the field creation when no Paragraphs types are available.

File

tests/src/Functional/WidgetLegacy/ParagraphsAddModesTest.php, line 35

Class

ParagraphsAddModesTest
Tests paragraphs add modes.

Namespace

Drupal\Tests\paragraphs\Functional\WidgetLegacy

Code

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

  // Edit the field and save when there are no Paragraphs types available.
  $this
    ->drupalGet('admin/structure/types/manage/paragraphed_test/fields');
  $this
    ->clickLink('Edit');
  $this
    ->submitForm([], 'Save settings');
  $this
    ->assertSession()
    ->pageTextContains('Saved paragraphs configuration.');
}