Skip to content

Commit

Permalink
EWPP-3129: Update the privacy policy link and update test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra authored and sergepavle committed Mar 3, 2023
1 parent b6a8889 commit 6fd4144
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function oe_theme_contact_forms_form_contact_message_form_alter(&$form, FormStat

// Add ecl link classes to the privacy link.
$privacy_policy = $contact_form->getThirdPartySetting('oe_contact_forms', 'privacy_policy');
$privacy_link = Link::fromTextAndUrl(t('data protection terms'), Url::fromUri($privacy_policy, [
$privacy_link = Link::fromTextAndUrl(t('personal data protection terms'), Url::fromUri($privacy_policy, [
'absolute' => TRUE,
'attributes' => [
'target' => '_blank',
Expand Down
8 changes: 6 additions & 2 deletions tests/src/Kernel/ContactFormRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ public function testContactForm(): void {

$actual = $crawler->filter('p.ecl-u-type-paragraph');
$this->assertCount(1, $actual);
$actual = $crawler->filter('.ecl-u-ml-2xs.ecl-link.ecl-link--default');
$this->assertCount(1, $actual);
$privacy_label = $crawler->filter('label.ecl-checkbox__label.form-required');
$this->assertCount(1, $privacy_label);
$this->assertEquals('I have read and agree with the personal data protection terms', $privacy_label->text());
$privacy_link = $crawler->filter('.ecl-u-ml-2xs.ecl-link.ecl-link--default');
$this->assertCount(1, $privacy_link);
$this->assertEquals('personal data protection terms', $privacy_link->text());
$actual = $crawler->filter('.ecl-u-mv-m');
$this->assertCount(7, $actual);
$telephone = $crawler->filter('.field--name-oe-telephone input');
Expand Down

0 comments on commit 6fd4144

Please sign in to comment.