Skip to content

Commit

Permalink
ACMS-4373: Acquia Starter Kit Tour fix failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra committed Dec 20, 2024
1 parent 0c2add3 commit 32406f4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Drupal\Tests\BrowserTestBase;
use Drupal\geocoder\Entity\GeocoderProvider;
use Drupal\geocoder\GeocoderProviderInterface;

/**
* Tests the Acquia CMS Tour module's integration with Google Maps.
Expand Down Expand Up @@ -51,13 +52,23 @@ public function testAcquiaGoogleMaps() {
$account = $this->drupalCreateUser(['access acquia cms tour dashboard']);
$this->drupalLogin($account);

// Add Geocoder provider - googlemaps.
GeocoderProvider::create([
'id' => 'googlemaps',
'plugin' => 'googlemaps',
'configuration' => [
'apiKey' => 'oldkey12345',
],
])->save();

// Visit the tour page.
$this->drupalGet('/admin/tour/dashboard');
$assert_session->statusCodeEquals(200);

$container = $assert_session->elementExists('css', '[data-drupal-selector="edit-geocoder"]');
// API key should be blank to start.
$assert_session->fieldValueEquals('maps_api_key', '', $container);
$assert_session->fieldValueEquals('maps_api_key', 'oldkey12345', $container);
$container->fillField('edit-maps-api-key', '');
$container->pressButton('Save');
$assert_session->pageTextContains('Maps API key field is required.');

Expand Down
18 changes: 2 additions & 16 deletions modules/acquia_cms_tour/tests/src/Functional/GoogleTagManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ class GoogleTagManager extends BrowserTestBase {
'google_tag',
];

/**
* Disable strict config schema checks in this test.
*
* Cohesion has a lot of config schema errors, and until they are all fixed,
* this test cannot pass unless we disable strict config schema checking
* altogether. Since strict config schema isn't critically important in
* testing this functionality, it's okay to disable it for now, but it should
* be re-enabled (i.e., this property should be removed) as soon as possible.
*
* @var bool
*/
// @codingStandardsIgnoreStart
protected $strictConfigSchema = FALSE;
// @codingStandardsIgnoreEnd

/**
* Tests the Google Tag Manager Form.
*/
Expand All @@ -61,7 +46,8 @@ public function testGoogleTagManager() {
$container->pressButton('Save');
$assert_session->pageTextContains('The configuration options have been saved.');
// Test that the config values we expect are set correctly.
$tag_id = $this->config($this->config('google_tag.settings')->get('default_google_tag_entity'))->get('tag_container_ids');
$tag = $this->config('google_tag.settings')->get('default_google_tag_entity');
$tag_id = $this->config('google_tag.container.' . $tag)->get('tag_container_ids');
$this->assertEquals($tag_id, [$dummy_tag]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@ class HelpIntegrationTest extends BrowserTestBase {
'toolbar',
];

/**
* Disable strict config schema checks in this test.
*
* Scheduler has a config schema errors, and until it's fixed,
* this test cannot pass unless we disable strict config schema checking
* altogether. Since strict config schema isn't critically important in
* testing this functionality, it's okay to disable it for now, but it should
* be re-enabled (i.e., this property should be removed) as soon as possible.
*
* @var bool
*/
// @codingStandardsIgnoreStart
protected $strictConfigSchema = FALSE;
// @codingStandardsIgnoreEnd

/**
* Tests the Acquia CMS Tour module's integration with the core Help module.
*/
Expand Down
15 changes: 0 additions & 15 deletions modules/acquia_cms_tour/tests/src/Functional/RecaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ class RecaptchaTest extends BrowserTestBase {
'recaptcha',
];

/**
* Disable strict config schema checks in this test.
*
* Cohesion has a lot of config schema errors, and until they are all fixed,
* this test cannot pass unless we disable strict config schema checking
* altogether. Since strict config schema isn't critically important in
* testing this functionality, it's okay to disable it for now, but it should
* be re-enabled (i.e., this property should be removed) as soon as possible.
*
* @var bool
*/
// @codingStandardsIgnoreStart
protected $strictConfigSchema = FALSE;
// @codingStandardsIgnoreEnd

/**
* Tests the Recaptcha Form.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ class AcquiaTourDashboardTest extends KernelTestBase {
'acquia_cms_tour',
];

/**
* Disable strict config schema checks in this test.
*
* Cohesion has a lot of config schema errors, and until they are all fixed,
* this test cannot pass unless we disable strict config schema checking
* altogether. Since strict config schema isn't critically important in
* testing this functionality, it's okay to disable it for now, but it should
* be re-enabled (i.e., this property should be removed) as soon as possible.
*
* @var bool
*/
// @codingStandardsIgnoreStart
protected $strictConfigSchema = FALSE;
// @codingStandardsIgnoreEnd

/**
* Tests AcquiaCMSTour plugins and make sure they are sorted per weights.
*/
Expand Down

0 comments on commit 32406f4

Please sign in to comment.