diff --git a/config_help.links.task.yml b/config_help.links.task.yml index 3ce34f1..8bb4b3f 100644 --- a/config_help.links.task.yml +++ b/config_help.links.task.yml @@ -1,9 +1,15 @@ entity.help_topic.canonical: - title: 'View' + title: View route_name: entity.help_topic.canonical base_route: entity.help_topic.edit_form entity.help_topic.edit_form: - title: 'Edit' + title: Edit route_name: entity.help_topic.edit_form base_route: entity.help_topic.edit_form + +entity.help_topic.delete_form: + route_name: entity.help_topic.delete_form + base_route: entity.help_topic.edit_form + title: Delete + weight: 10 diff --git a/tests/src/Functional/HelpTopicAdminTest.php b/tests/src/Functional/HelpTopicAdminTest.php index 5179c13..35bafc8 100644 --- a/tests/src/Functional/HelpTopicAdminTest.php +++ b/tests/src/Functional/HelpTopicAdminTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\config_help\Functional; +use Drupal\language\Entity\ConfigurableLanguage; use Drupal\Tests\BrowserTestBase; /** @@ -317,4 +318,29 @@ class HelpTopicAdminTest extends BrowserTestBase { $this->assertNoLink($title); } + /** + * Tests tabs on topic view page. + */ + public function testTabsVisible() { + // Install config translation module to test translation tab. + $this->container->get('module_installer') + ->install(['config_translation', 'locale', 'language']); + ConfigurableLanguage::createFromLangcode('es')->save(); + + $user = $this->createUser([ + 'access administration pages', + 'administer help topics', + 'use text format help', + 'view help topics', + 'administer help topic locking', + 'translate configuration', + ]); + $this->drupalLogin($user); + foreach (['View', 'Edit', 'Delete', 'Translate help topic'] as $label) { + $this->drupalGet('admin/help-topic/help_test'); + $this->clickLink($label); + $this->assertSession()->statusCodeEquals(200); + } + } + }