Commit 24f6e64c authored by catch's avatar catch
Browse files

task: #3582098 Update core/tests that use Claro to Admin

By: quietone
parent 55148447
Loading
Loading
Loading
Loading
+5 −5
Changes for core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTest.php: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@ class AjaxTest extends WebDriverTestBase {
   * Tests that AJAX works on admin routes.
   */
  public function testAjaxWithAdminRoute(): void {
    \Drupal::service('theme_installer')->install(['stark', 'claro']);
    \Drupal::service('theme_installer')->install(['stark', 'default_admin']);
    $theme_config = \Drupal::configFactory()->getEditable('system.theme');
    $theme_config->set('admin', 'claro');
    $theme_config->set('admin', 'default_admin');
    $theme_config->set('default', 'stark');
    $theme_config->save();

@@ -43,7 +43,7 @@ public function testAjaxWithAdminRoute(): void {
    // admin theme.
    $this->drupalGet('admin/ajax-test/theme');
    $assert = $this->assertSession();
    $assert->pageTextContains('Current theme: claro');
    $assert->pageTextContains('Current theme: default_admin');

    // Now click the modal, which should use the front-end theme.
    $this->drupalGet('ajax-test/dialog');
@@ -52,7 +52,7 @@ public function testAjaxWithAdminRoute(): void {
    $assert->assertWaitOnAjaxRequest();

    $assert->pageTextContains('Current theme: stark');
    $assert->pageTextNotContains('Current theme: claro');
    $assert->pageTextNotContains('Current theme: default_admin');
  }

  /**
@@ -273,7 +273,7 @@ protected function assertWaitPageContains(string $expected): void {
   */
  public function testUiAjaxException(): void {
    $themes = [
      'claro',
      'olivero',
      'default_admin',
      'stark',
    ];
+4 −4
Changes for core/tests/Drupal/FunctionalJavascriptTests/Theme/AdminBlockFilterTest.php: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -9,21 +9,21 @@
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Runs BlockFilterTest in Claro.
 * Runs BlockFilterTest in Admin.
 *
 * @see \Drupal\Tests\block\FunctionalJavascript\BlockFilterTest.
 */
#[Group('block')]
#[RunTestsInSeparateProcesses]
class ClaroBlockFilterTest extends BlockFilterTest {
class AdminBlockFilterTest extends BlockFilterTest {

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->container->get('theme_installer')->install(['claro']);
    $this->config('system.theme')->set('default', 'claro')->save();
    $this->container->get('theme_installer')->install(['default_admin']);
    $this->config('system.theme')->set('default', 'default_admin')->save();
  }

}
+7 −7
Changes for core/tests/Drupal/FunctionalJavascriptTests/Theme/AdminEntityDisplayTest.php: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -10,21 +10,21 @@
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Runs EntityDisplayTest in Claro.
 * Runs EntityDisplayTest in Admin.
 *
 * @see \Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest.
 */
#[Group('claro')]
#[Group('default_admin')]
#[RunTestsInSeparateProcesses]
class ClaroEntityDisplayTest extends EntityDisplayTest {
class AdminEntityDisplayTest extends EntityDisplayTest {

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->container->get('theme_installer')->install(['claro']);
    $this->config('system.theme')->set('default', 'claro')->save();
    $this->container->get('theme_installer')->install(['default_admin']);
    $this->config('system.theme')->set('default', 'default_admin')->save();
  }

  /**
@@ -78,14 +78,14 @@ public function testEntityView(): void {
    $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'content')->isSelected());

    $this->drupalGet('entity_test/1');
    $this->assertSession()->elementExists('css', '.field--name-field-test-text');
    $this->assertSession()->pageTextContains('The field test text value');
  }

  /**
   * Copied from parent.
   *
   * This is Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest::testExtraFields()
   * with a line changed to reflect Claro's tabledrag selector.
   * with a line changed to reflect Admin's tabledrag selector.
   */
  public function testExtraFields(): void {
    EntityTestHelper::createBundle('bundle_with_extra_fields');
+3 −3
Changes for core/tests/Drupal/FunctionalJavascriptTests/Theme/AdminModalDisplayTest.php: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -15,17 +15,17 @@
/**
 * Tests that buttons in modals are not in their button pane.
 */
#[Group('claro')]
#[Group('default_admin')]
#[Group('#slow')]
#[RunTestsInSeparateProcesses]
class ClaroModalDisplayTest extends MediaLibraryTestBase {
class AdminModalDisplayTest extends MediaLibraryTestBase {

  use TestFileCreationTrait;

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'claro';
  protected $defaultTheme = 'default_admin';

  /**
   * Tests the position f "add another" button in dialogs.
+5 −5
Changes for core/tests/Drupal/FunctionalJavascriptTests/Theme/AdminPasswordConfirmWidgetTest.php: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -9,16 +9,16 @@
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests the password confirm widget with Claro theme.
 * Tests the password confirm widget with Admin theme.
 */
#[Group('claro')]
#[Group('default_admin')]
#[RunTestsInSeparateProcesses]
class ClaroPasswordConfirmWidgetTest extends PasswordConfirmWidgetTest {
class AdminPasswordConfirmWidgetTest extends PasswordConfirmWidgetTest {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'claro';
  protected $defaultTheme = 'default_admin';

  /**
   * Tests that password match message is invisible when widget is initialized.
@@ -39,7 +39,7 @@ public function testPasswordConfirmMessage(): void {
   * {@inheritdoc}
   */
  public function testFillConfirmOnly(): void {
    // This test is not applicable to Claro because confirm field is hidden
    // This test is not applicable to Admin because confirm field is hidden
    // until the password has been filled in the main field.
  }

Loading