diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php index 43182a5..2090f01 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php @@ -131,7 +131,8 @@ function testEnabledTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on comment manage fields page for a field. + * Tests Yes in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testEnabledFieldTranslatableColumnManageFieldsTab() { @@ -146,7 +147,8 @@ function testEnabledFieldTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on comment manage fields page for a disabled field. + * Tests '' in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testDisabledFieldTranslatableColumnManageFieldsTab() { @@ -159,4 +161,19 @@ function testDisabledFieldTranslatableColumnManageFieldsTab() { $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]/span[@class="element-invisible"]', 'Not translatable', 'Translation is disabled on field. Invisible element exists'); } + /** + * Tests n/a in Translatable column on manage fields tab for a translatable field. + * Also test the invisible span included for screen readers + */ + function testNonTranslatableFieldTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer content types', 'access administration pages', 'access content overview', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/types/manage/' . $this->nodeBundle . '/comment/fields'); + + // Check that the field appears in the overview form. + $this->assertFieldByXPath('//tr[@id="author"]/td[6]', 'n/a', 'Translation is not supported on field'); + $this->assertFieldByXPath('//tr[@id="author"]/td[6]/span[@class="element-invisible"]', 'Translation not supported', 'Translation is not supported on field. Invisible element exists'); + } + } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php index ba9d88b..be14ea0 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php @@ -122,7 +122,8 @@ function testEnabledTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on content-type manage fields page for a field. + * Tests Yes in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testEnabledFieldTranslatableColumnManageFieldsTab() { @@ -137,7 +138,8 @@ function testEnabledFieldTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on content-type manage fields page for a disabled field. + * Tests '' in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testDisabledFieldTranslatableColumnManageFieldsTab() { @@ -149,4 +151,19 @@ function testDisabledFieldTranslatableColumnManageFieldsTab() { $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]', '', 'Translation is disabled on field'); $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]/span[@class="element-invisible"]', 'Not translatable', 'Translation is disabled on field. Invisible element exists'); } + + /** + * Tests n/a in Translatable column on manage fields tab for a translatable field. + * Also test the invisible span included for screen readers + */ + function testNonTranslatableFieldTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer content types', 'access administration pages', 'access content overview', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/types/manage/' . $this->bundle . '/fields'); + + // Check that the field appears in the overview form. + $this->assertFieldByXPath('//tr[@id="title"]/td[6]', 'n/a', 'Translation is not supported on field'); + $this->assertFieldByXPath('//tr[@id="title"]/td[6]/span[@class="element-invisible"]', 'Translation not supported', 'Translation is not supported on field. Invisible element exists'); + } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php index d6c3829..f796dde 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php @@ -158,7 +158,8 @@ function testEnabledTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on taxonomy Manage fields page for a field. + * Tests Yes in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testEnabledFieldTranslatableColumnManageFieldsTab() { @@ -173,7 +174,8 @@ function testEnabledFieldTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on taxonomy Manage fields page for a disabled field. + * Tests '' in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testDisabledFieldTranslatableColumnManageFieldsTab() { @@ -186,4 +188,19 @@ function testDisabledFieldTranslatableColumnManageFieldsTab() { $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]/span[@class="element-invisible"]', 'Not translatable', 'Translation is disabled on field. Invisible element exists'); } + /** + * Tests n/a in Translatable column on manage fields tab for a translatable field. + * Also test the invisible span included for screen readers + */ + function testNonTranslatableFieldTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'access administration pages', 'administer nodes')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/taxonomy/' . $this->bundle . '/fields'); + + // Check that the field appears in the overview form. + $this->assertFieldByXPath('//tr[@id="name"]/td[6]', 'n/a', 'Translation is not supported on field'); + $this->assertFieldByXPath('//tr[@id="name"]/td[6]/span[@class="element-invisible"]', 'Translation not supported', 'Translation is not supported on field. Invisible element exists'); + } + } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php index b7ebd25..8d1bd6d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php @@ -93,7 +93,8 @@ function testEnabledTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on account fields page. + * Tests Yes in Translatable column on account fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testEnabledFieldTranslatableColumnManageFieldsTab() { @@ -108,7 +109,8 @@ function testEnabledFieldTranslatableColumnManageFieldsTab() { } /** - * Tests translatable column on account fields page for disabled field. + * Tests '' in Translatable column on manage fields tab for a translatable field. + * Also test the invisible words included for screen readers */ function testDisabledFieldTranslatableColumnManageFieldsTab() { @@ -120,4 +122,19 @@ function testDisabledFieldTranslatableColumnManageFieldsTab() { $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]', '', 'Translation is disabled on field'); $this->assertFieldByXPath('//tr[@id="field-test-et-ui-test-disabled"]/td[7]/span[@class="element-invisible"]', 'Not translatable', 'Translation is disabled on field. Invisible element exists'); } + + /** + * Tests n/a in Translatable column on manage fields tab for a translatable field. + * Also test the invisible span included for screen readers + */ + function testNonTranslatableFieldTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer users')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/config/people/accounts/fields'); + + // Check that the field appears in the overview form. + $this->assertFieldByXPath('//tr[@id="account"]/td[6]', 'n/a', 'Translation is not supported on field'); + $this->assertFieldByXPath('//tr[@id="account"]/td[6]/span[@class="element-invisible"]', 'Translation not supported', 'Translation is not supported on field. Invisible element exists'); + } }