Skip to content

Commit

Permalink
Adjust acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 20, 2023
1 parent 5dd6d10 commit ec29d69
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/codeception/functional/Contrib/ExtLinkCest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Faker\Factory;
use Drupal\config_pages\Entity\ConfigPages;

/**
Expand All @@ -8,6 +9,12 @@
* @group ext_links
*/
class ExtLinkCest {

/**
* @var Faker
*/
protected $faker;

/**
* Start with a clean config page.
*
Expand All @@ -18,6 +25,13 @@ public function _before(FunctionalTester $I){
$this->_after($I);
}

/**
* Test Constructor.
*/
public function __construct() {
$this->faker = Factory::create();
}

/**
* Always cleanup the config after testing.
*
Expand All @@ -37,10 +51,22 @@ public function _after(FunctionalTester $I) {
* Test external links get the added class and svg.
*/
public function testExtLink(FunctionalTester $I) {
$org_term = $I->createEntity([
'vid' => 'site_owner_orgs',
'name' => $this->faker->words(2, TRUE),
], 'taxonomy_term');

$I->logInWithRole('site_manager');
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->uncheckOption('Hide External Link Icons');

$I->click('Contact Details');
$I->fillField('Site Owner Contact (value 1)', $this->faker->email);
$I->fillField('Technical Contact (value 1)', $this->faker->email);
$I->fillField('Accessibility Contact (value 1)', $this->faker->email);
$I->selectOption('Org Code', $org_term->id());
$I->click('Save');
$I->cansee('has been updated');

$I->amOnPage('/admin/config/system/local-footer');
$I->checkOption('#edit-su-footer-enabled-value');
Expand Down

0 comments on commit ec29d69

Please sign in to comment.