2c2 < index e22ecd8270..32d4808ec9 100644 --- > index b984783a9d..634163d2e7 100644 6c6 < --- > 15c15 < --- > 294c294 < index ae798fd1c3..bdc9567b1f 100644 --- > index 0cf5548b9c..d023cb0ae8 100644 297,306c297,298 < @@ -3,6 +3,7 @@ < namespace Drupal\Tests\config_translation\Functional; < < use Drupal\block_content\Entity\BlockContentType; < +use Drupal\Core\Entity\Entity\EntityFormDisplay; < use Drupal\field\Entity\FieldConfig; < use Drupal\field\Entity\FieldStorageConfig; < use Drupal\language\Entity\ConfigurableLanguage; < @@ -504,4 +505,20 @@ public function testTranslateOperationInListUi() { < $this->doSettingsPageTest('admin/config/people/accounts'); --- > @@ -479,6 +479,46 @@ public function doSettingsPageTest($link) { > $this->assertSession()->responseContains('Language'); 308c300 < --- > 310c302 < + * Asserts that missing default display does not break the form display page. --- > + * Test entity form translation operation. 312,321c304,337 < + public function testDisplayTranslation() { < + $this->drupalLogin($this->rootUser); < + // Setup vocabulary. < + Vocabulary::create([ < + 'vid' => 'tags', < + 'name' => 'Tags', < + ])->save(); < + // Assert there is no default form display. < + $this->assertNull(EntityFormDisplay::load('taxonomy_term.tags.default')); < + $this->drupalGet('admin/structure/taxonomy/manage/tags/overview/form-display'); --- > + public function doEntityFormTest() { > + $content_type = $this->drupalCreateContentType([ > + 'type' => mb_strtolower($this->randomMachineName(16)), > + 'name' => $this->randomMachineName(), > + ]); > + > + $this->drupalGet('admin/config/regional/config-translation'); > + $this->assertSession()->linkByHrefExists('admin/config/regional/config-translation/node_form_display'); > + > + $this->drupalGet('admin/config/regional/config-translation/node_form_display'); > + $this->assertSession()->statusCodeEquals(200); > + $this->assertSession()->linkByHrefExists('admin/structure/types/manage/' . $content_type->id() . '/form-display/default/translate'); > + > + $this->drupalGet('admin/structure/types/manage/' . $content_type->id() . '/form-display/default/translate'); > + $this->assertSession()->statusCodeEquals(200); > + } > + > + /** > + * Test entity view display translation operation. > + */ > + public function doViewDisplayTest() { > + $content_type = $this->drupalCreateContentType([ > + 'type' => mb_strtolower($this->randomMachineName(16)), > + 'name' => $this->randomMachineName(), > + ]); > + > + $this->drupalGet('admin/config/regional/config-translation'); > + $this->assertSession()->linkByHrefExists('admin/config/regional/config-translation/node_view_display'); > + > + $this->drupalGet('admin/config/regional/config-translation/node_view_display'); > + $this->assertSession()->statusCodeEquals(200); > + $this->assertSession()->linkByHrefExists('/admin/structure/types/manage/' . $content_type->id() . '/display/default/translate'); > + > + $this->drupalGet('admin/structure/types/manage/' . $content_type->id() . '/display/default/translate'); 325c341,352 < } --- > /** > * Tests if translate link is added to operations in all configuration lists. > */ > @@ -498,6 +538,8 @@ public function testTranslateOperationInListUi() { > $this->doResponsiveImageListTest(); > $this->doDateFormatListTest(); > $this->doFieldListTest(); > + $this->doEntityFormTest(); > + $this->doViewDisplayTest(); > > // Views is tested in Drupal\config_translation\Tests\ConfigTranslationViewListUiTest >