private function LayoutBuilderQuickEditTest::assertQuickEditInit in Drupal 10
Same name and namespace in other branches
- 9 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::assertQuickEditInit()
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.
File
- core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ LayoutBuilderQuickEditTest.php, line 331
Class
- LayoutBuilderQuickEditTest
- Tests that Layout Builder functions with Quick Edit.
Namespace
Drupal\Tests\quickedit\FunctionalJavascriptCode
private function assertQuickEditInit(array $fields) : void {
$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);
}