Commit 6fae129a authored by l26yan's avatar l26yan Committed by Igor Biki
Browse files

ISTWCMS-4862 Test helf text when creating catalog item nodes without catalog term

parent 3edc3264
......@@ -375,6 +375,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
// The message is displayed when creating a catalog item
// without a catalog term created.
$this->assertSession()->pageTextContains('You must create at least one catalog before adding a catalog item.');
// Content Author default has 'create terms in uw_vocab_catalogs',
// so when creating a catalog node, 'Add a catalog' link
// shows without any catalog term created.
$this->assertSession()->linkExists('Add a catalog');
$href = $this->getSession()->getPage()->find('xpath', "//a[contains(text(), 'Add a catalog.')]");
$this->assertEquals(base_path() . 'admin/structure/taxonomy/manage/uw_vocab_catalogs/add', $href->getAttribute('href'));
// Revoke Content Author 'create terms in uw_vocab_catalogs' permission.
user_role_revoke_permissions('uw_role_content_author', ['create terms in uw_vocab_catalogs']);
// When creating catalog node, the help text shows
// without any catalog term created.
$this->assertSession()->pageTextContains('Reach out to someone who has access to add a catalog.');
// Grant Content Author 'create terms in uw_vocab_catalogs'
// permission again for late use.
user_role_grant_permissions('uw_role_content_author', ['create terms in uw_vocab_catalogs']);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment