Skip to content
Snippets Groups Projects
Commit ef337b69 authored by catch's avatar catch
Browse files

Issue #3521621 by mstrelan: [random test failure] jQuery Events Deprecation...

Issue #3521621 by mstrelan: [random test failure] jQuery Events Deprecation Tests (Tests/dialogDeprecations)

(cherry picked from commit f9237efb)
parent 76508d60
No related branches found
No related tags found
1 merge request!122353526426-warning-for-missing
Pipeline #484599 passed
Pipeline: drupal

#484602

    <?php
    declare(strict_types=1);
    namespace Drupal\FunctionalJavascriptTests\Dialog;
    use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
    use PHPUnit\Framework\Attributes\IgnoreDeprecations;
    /**
    * Tests jQuery events deprecations.
    *
    * @group dialog
    */
    class DialogDeprecationsTest extends WebDriverTestBase {
    /**
    * {@inheritdoc}
    */
    protected $defaultTheme = 'stark';
    /**
    * {@inheritdoc}
    */
    protected static $modules = [
    'block',
    'js_deprecation_test',
    ];
    /**
    * Tests that the deprecation events are triggered.
    */
    #[IgnoreDeprecations]
    public function testDialogDeprecations(): void {
    $this->drupalLogin($this->drupalCreateUser(['administer blocks']));
    $this->drupalGet('/admin/structure/block');
    $assert_session = $this->assertSession();
    $button = $assert_session->waitForElement('css', '[data-drupal-selector="edit-blocks-region-sidebar-first-title"]');
    $this->assertNotNull($button);
    $button->click();
    $this->getSession()->executeScript(<<<JS
    setTimeout(() => {
    window.jQuery('.ui-dialog-content').trigger('dialogButtonsChange');
    }, 100);
    JS);
    $this->expectDeprecation('Javascript Deprecation: jQuery event dialogButtonsChange is deprecated in 11.2.0 and is removed from Drupal:12.0.0. See https://www.drupal.org/node/3464202');
    }
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment