Tests the add drop down button.
public function testDropDownMode() {
$this
->loginAsAdmin();
// Add two Paragraph types.
$this
->addParagraphsType('btext');
$this
->addParagraphsType('dtext');
$this
->addParagraphedContentType('paragraphed_test', 'paragraphs');
// Enter to the field config since the weight is set through the form.
$this
->drupalGet('admin/structure/types/manage/paragraphed_test/fields/node.paragraphed_test.paragraphs');
$this
->submitForm([], 'Save settings');
$this
->setAddMode('paragraphed_test', 'paragraphs', 'dropdown');
$this
->assertAddButtons([
'Add btext',
'Add dtext',
]);
$this
->addParagraphsType('atext');
$this
->assertAddButtons([
'Add btext',
'Add dtext',
'Add atext',
]);
$this
->setParagraphsTypeWeight('paragraphed_test', 'dtext', 2, 'paragraphs');
$this
->assertAddButtons([
'Add dtext',
'Add btext',
'Add atext',
]);
$this
->setAllowedParagraphsTypes('paragraphed_test', [
'dtext',
'atext',
], TRUE, 'paragraphs');
$this
->assertAddButtons([
'Add dtext',
'Add atext',
]);
$this
->setParagraphsTypeWeight('paragraphed_test', 'atext', 1, 'paragraphs');
$this
->assertAddButtons([
'Add atext',
'Add dtext',
]);
$this
->setAllowedParagraphsTypes('paragraphed_test', [
'atext',
'dtext',
'btext',
], TRUE, 'paragraphs');
$this
->assertAddButtons([
'Add atext',
'Add dtext',
'Add btext',
]);
}