- $this->drupalPostAjaxForm('node/' . $node->id() . '/edit', [], 'field_paragraphs_0_edit');
- // Try to collapse with an invalid reference.
- $this->drupalPostAjaxForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'], 'field_paragraphs_0_collapse');
+ $this->drupalGet('node/' . $node->id() . '/edit');
+ // Since we have another validation error, the paragraph is by default in
+ // the edit mode again.
+ $this->assertFieldByName('field_paragraphs[0][subform][field_entity_reference][0][target_id]');
+ $this->assertFieldByName('field_paragraphs[0][subform][field_entity_reference][1][target_id]');
+ // Try to save with and invalid reference.
+ $edit = ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'];
+ $this->drupalPostForm(NULL, $edit, t('Save'));