Commit c0c5c42e authored by Igor Biki's avatar Igor Biki
Browse files

Merge branch...

Merge branch 'feature/ISTWCMS-4862-l26yan-Add-help-text-to-Catalog-when-no-catalog-term-created' into '3.0.x'

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

See merge request !163
parents 3edc3264 6fae129a
......@@ -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->drupalGet($type);
$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