private function LayoutBuilderQuickEditTest::assertQuickEditInit in Drupal 8
Asserts that Quick Edit is initialized on the node view correctly.
@todo Replace calls to this method with calls to ::doTestArticle() in https://www.drupal.org/node/3037436.
Parameters
string[] $fields: The fields test.
2 calls to LayoutBuilderQuickEditTest::assertQuickEditInit()
- LayoutBuilderQuickEditTest::testEnableDisableLayoutBuilder in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderQuickEditTest.php - Tests Quick Edit boots correctly with Layout Builder defaults & overrides.
- LayoutBuilderQuickEditTest::testQuickEditIgnoresDuplicateFields in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderQuickEditTest.php - Tests that Quick Edit still works even when there are duplicate fields.
File
- core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderQuickEditTest.php, line 307
Class
- LayoutBuilderQuickEditTest
- Tests that Layout Builder functions with Quick Edit.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
private function assertQuickEditInit(array $fields) {
$this
->assertNotEmpty($fields);
$node = $this->article;
$this
->drupalGet('node/' . $node
->id());
// Initial state.
$this
->awaitQuickEditForEntity('node', 1);
$this
->assertEntityInstanceStates([
'node/1[0]' => 'closed',
]);
$field_states = [];
foreach ($fields as $field) {
$field_states["node/1/{$field}/en/full"] = 'inactive';
}
$this
->assertEntityInstanceFieldStates('node', 1, 0, $field_states);
}