Commit d7077fee authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4613: Test theming of uw_cbl_related_links

parent d5171a14
......@@ -777,6 +777,35 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertFieldByXPath('//div[@class="uw-powerbi"]/iframe[@src="' . $edit['edit-settings-block-form-field-uw-powerbi-url-0-value'] . '"]');
break;
case 'Related links':
// Add a second link.
$this->click('#edit-settings-block-form-field-uw-rl-related-link-add-more');
// Create Related links block.
$edit = [
'edit-settings-label' => $this->randomString(),
// Internal link.
'edit-settings-block-form-field-uw-rl-related-link-0-uri' => 'entity:node/1',
'edit-settings-block-form-field-uw-rl-related-link-0-title' => 'should-not-appear--uses-node-title',
// External link.
'edit-settings-block-form-field-uw-rl-related-link-1-uri' => 'https://www.sju.ca/',
// This needs to use randomMachineName() so that it has not
// double-quotes, which cannot be in XPath.
'edit-settings-block-form-field-uw-rl-related-link-1-title' => $this->randomMachineName(),
];
$this->submitForm($edit, 'Add block');
// Test that the Related links block markup appears on the page.
$this->assertSession()->pageTextContains($edit['edit-settings-label']);
// Internal link.
$xpath_prefix = '//div[contains(@class, "block-inline-blockuw-cbl-related-links")]/div[@class="item-list"]/ul/li';
$this->assertFieldByXPath($xpath_prefix . '/a[@href="' . base_path() . 'home" and text()="Home"]');
$this->assertSession()->pageTextNotContains($edit['edit-settings-block-form-field-uw-rl-related-link-0-title']);
// External link.
$this->assertFieldByXPath($xpath_prefix . '/a[@href="' . $edit['edit-settings-block-form-field-uw-rl-related-link-1-uri'] . '" and text()="' . $edit['edit-settings-block-form-field-uw-rl-related-link-1-title'] . '"]');
unset($xpath_prefix);
break;
case 'Tableau visualization':
// Create Tableau block.
$edit = [
......
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