Skip to content
Snippets Groups Projects
Commit 469eb4e9 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4722 Test to make sure cta block has no icon option

parent 8796dca4
No related branches found
No related tags found
3 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!136Istwcms 4725 ebremner config sync,!107ISTWCMS-4722 Test to make sure cta block has no icon option
......@@ -1009,6 +1009,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
private function ctaBlockTest() {
$this->drupalLogin($this->drupalUsers['administrator']);
// Make sure the type of CTA text details doesn't include 'icon'
// under Text details settings.
$this->drupalGet('admin/structure/paragraphs_type/uw_para_call_to_action/fields/paragraph.uw_para_call_to_action.field_uw_cta_text_details');
$this->assertSession()->statusCodeEquals(200);
$small = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'small');
$this->assertTrue($small);
$this->assertEquals('Small', $small->getText());
$medium = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'medium');
$this->assertTrue($medium);
$this->assertEquals('Medium', $medium->getText());
$big = $this->assertSession()->optionExists('default_value_input[field_uw_cta_text_details][0][style]', 'big');
$this->assertTrue($big);
$this->assertEquals('Big', $big->getText());
$this->assertSession()->optionNotExists('default_value_input[field_uw_cta_text_details][0][style]', 'icon/image');
// Make sure CTA link field and theme required.
$this->drupalGet('admin/structure/paragraphs_type/uw_para_call_to_action/fields/paragraph.uw_para_call_to_action.field_uw_cta_link');
$this->assertSession()->statusCodeEquals(200);
......@@ -1041,6 +1056,19 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertEquals('js-form-required form-required', $ctatheme->getAttribute('class'));
$this->assertSession()->pageTextNotContains('Link text');
// Make sure the type of CTA text details doesn't include 'icon'
// when add 'call to action' block.
$small = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'small');
$this->assertTrue($small);
$this->assertEquals('Small', $small->getText());
$medium = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'medium');
$this->assertTrue($medium);
$this->assertEquals('Medium', $medium->getText());
$big = $this->assertSession()->optionExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'big');
$this->assertTrue($big);
$this->assertEquals('Big', $big->getText());
$this->assertSession()->optionNotExists('settings[block_form][field_uw_cta_details][0][subform][field_uw_cta_text_details][0][style]', 'icon/image');
// Use random string as cta label, saving for later compare.
$cta_label = $this->randomString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment