Verified Commit 91a722eb authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

task: #3582101 Make Admin the default theme in profiles and recipes

By: quietone
By: smustgrave
By: gábor hojtsy
By: dcam
By: godotislate
parent 3ef14e7a
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/contact/tests/src/Functional/migrate_drupal_ui/d7/Upgrade7Test.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ protected function setUp(): void {

    $this->loadFixture($this->getModulePath('contact') . '/tests/fixtures/drupal7.php');

    $this->expectedLoggedErrors = 18;
    $this->expectedLoggedErrors = 20;
    // If saving the logs, then set the admin user.
    if ($this->outputLogs) {
      $this->migratedAdminUserName = 'admin';
+28 −27
Changes for core/modules/media/tests/src/FunctionalJavascript/MediaStandardProfileTest.php: 28 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -157,12 +157,13 @@ protected function audioTest(): void {
    $media = \Drupal::entityTypeManager()->getStorage('media')->loadUnchanged($audio_media_id);
    $this->assertSame($test_filename, $media->label());

    // Here we expect to see only the linked filename. Assert the audio field exists.
    $assert_session->elementsCount('css', '.field--name-field-media-audio-file', 1);
    // Here we expect to see only the linked filename. Assert the audio element
    // exists.
    $assert_session->elementsCount('css', '#block-default-admin-content audio', 1);

    // Assert the audio file is present inside the media element and that its
    // src attribute matches the audio file.
    $audio_element = $assert_session->elementExists('css', '.field--name-field-media-audio-file audio > source');
    $audio_element = $assert_session->elementExists('css', '#block-default-admin-content audio > source');
    /** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
    $file_url_generator = \Drupal::service('file_url_generator');
    $expected_audio_src = $file_url_generator->generate(\Drupal::token()->replace('public://[date:custom:Y]-[date:custom:m]/' . $test_filename))->toString();
@@ -185,13 +186,13 @@ protected function audioTest(): void {
    $media = \Drupal::entityTypeManager()->getStorage('media')->loadUnchanged($audio_media_id);
    $this->assertSame($test_filename_updated, $media->label());

    // Again we expect to see only the linked filename. Assert only one element
    // in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-audio-file', 1);
    // Again we expect to see only the linked filename. Assert only one audio
    // field in the content region.
    $assert_session->elementsCount('css', '#block-default-admin-content audio', 1);

    // Assert the audio file is present inside the media element and that its
    // src attribute matches the updated audio file.
    $audio_element = $assert_session->elementExists('css', '.field--name-field-media-audio-file audio > source');
    $audio_element = $assert_session->elementExists('css', '#block-default-admin-content audio > source');
    $expected_audio_src = $file_url_generator->generate(\Drupal::token()->replace('public://[date:custom:Y]-[date:custom:m]/' . $test_filename_updated))->toString();
    $this->assertSame($expected_audio_src, $audio_element->getAttribute('src'));
  }
@@ -246,19 +247,19 @@ protected function imageTest(): void {

    // Here we expect to see only the image, nothing else. Assert only one
    // element in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-image', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content img', 1);

    // Assert the image element is present inside the media element and that its
    // src attribute uses the large image style, the label is visually hidden,
    // and there is no link to the image file.
    $image_element = $assert_session->elementExists('css', '.field--name-field-media-image img');
    $image_element = $assert_session->elementExists('css', '#block-default-admin-content img');
    /** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
    $file_url_generator = \Drupal::service('file_url_generator');
    $expected_image_src = $file_url_generator->generate(\Drupal::token()->replace('public://styles/large/public/[date:custom:Y]-[date:custom:m]/' . $image_media_name))->toString();

    $this->assertStringContainsString($expected_image_src, $image_element->getAttribute('src'));
    $assert_session->elementExists('css', '.field--name-field-media-image .field__label.visually-hidden');
    $assert_session->elementNotExists('css', '.field--name-field-media-image a');
    $assert_session->elementExists('css', '#block-default-admin-content div.visually-hidden');
    $assert_session->elementNotExists('css', '#block-default-admin-content img a');

    // Assert the media name is updated through the field mapping when changing
    // the source field.
@@ -281,16 +282,16 @@ protected function imageTest(): void {

    // Again we expect to see only the image, nothing else. Assert only one
    // element in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-image', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content img', 1);

    // Assert the image element is present inside the media element and that its
    // src attribute uses the large image style, the label is visually hidden,
    // and there is no link to the image file.
    $image_element = $assert_session->elementExists('css', '.field--name-field-media-image img');
    $image_element = $assert_session->elementExists('css', '#block-default-admin-content img');
    $expected_image_src = $file_url_generator->generate(\Drupal::token()->replace('public://styles/large/public/[date:custom:Y]-[date:custom:m]/' . $image_media_name_updated))->toString();
    $this->assertStringContainsString($expected_image_src, $image_element->getAttribute('src'));
    $assert_session->elementExists('css', '.field--name-field-media-image .field__label.visually-hidden');
    $assert_session->elementNotExists('css', '.field--name-field-media-image a');
    $assert_session->elementExists('css', '#block-default-admin-content div.visually-hidden');
    $assert_session->elementNotExists('css', '#block-default-admin-content img a');
  }

  /**
@@ -349,11 +350,11 @@ protected function documentTest(): void {

    // Here we expect to see only the linked filename. Assert only one element
    // in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-document', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content span.file', 1);

    // Assert the file link is present in the media element and its text matches
    // the filename.
    $link_element = $assert_session->elementExists('css', '.field--name-field-media-document a');
    $link_element = $assert_session->elementExists('css', '#block-default-admin-content span.file a');
    $this->assertSame($test_filename, $link_element->getText());

    // Assert the media name is updated through the field mapping when changing
@@ -375,11 +376,11 @@ protected function documentTest(): void {

    // Again we expect to see only the linked filename. Assert only one element
    // in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-document', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content span.file', 1);

    // Assert the file link is present in the media element and its text matches
    // the updated filename.
    $link_element = $assert_session->elementExists('css', '.field--name-field-media-document a');
    $link_element = $assert_session->elementExists('css', '#block-default-admin-content span.file a');
    $this->assertSame($test_filename_updated, $link_element->getText());
  }

@@ -437,11 +438,11 @@ protected function remoteVideoTest(): void {

    // Here we expect to see only the video iframe. Assert only one element in
    // the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-oembed-video', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content iframe', 1);

    // Assert the iframe is present in the media element and its src attribute
    // matches the URL and query parameters.
    $iframe_url = $assert_session->elementExists('css', '.field--name-field-media-oembed-video iframe')->getAttribute('src');
    $iframe_url = $assert_session->elementExists('css', '#block-default-admin-content iframe')->getAttribute('src');
    $iframe_url = parse_url($iframe_url);
    $this->assertStringEndsWith('/media/oembed', $iframe_url['path']);
    $this->assertNotEmpty($iframe_url['query']);
@@ -464,11 +465,11 @@ protected function remoteVideoTest(): void {

    // Again we expect to see only the video iframe. Assert only one element in
    // the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-oembed-video', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content iframe', 1);

    // Assert the iframe is present in the media element and its src attribute
    // matches the updated URL and query parameters.
    $iframe_url = $assert_session->elementExists('css', '.field--name-field-media-oembed-video iframe')->getAttribute('src');
    $iframe_url = $assert_session->elementExists('css', '#block-default-admin-content iframe')->getAttribute('src');
    $iframe_url = parse_url($iframe_url);
    $this->assertStringEndsWith('/media/oembed', $iframe_url['path']);
    $this->assertNotEmpty($iframe_url['query']);
@@ -534,11 +535,11 @@ protected function videoTest(): void {

    // Here we expect to see only the linked filename. Assert only one element
    // in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-video-file', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content video', 1);

    // Assert the video element is present inside the media element and that its
    // src attribute matches the video file.
    $video_element = $assert_session->elementExists('css', '.field--name-field-media-video-file video > source');
    $video_element = $assert_session->elementExists('css', '#block-default-admin-content video > source');
    /** @var \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator */
    $file_url_generator = \Drupal::service('file_url_generator');
    $expected_video_src = $file_url_generator->generate(\Drupal::token()->replace('public://[date:custom:Y]-[date:custom:m]/' . $test_filename))->toString();
@@ -563,11 +564,11 @@ protected function videoTest(): void {

    // Again we expect to see only the linked filename. Assert only one element
    // in the content region.
    $assert_session->elementsCount('css', '.field--name-field-media-video-file', 1);
    $assert_session->elementsCount('css', '#block-default-admin-content video', 1);

    // Assert the video element is present inside the media element and that its
    // src attribute matches the updated video file.
    $video_element = $assert_session->elementExists('css', '.field--name-field-media-video-file video > source');
    $video_element = $assert_session->elementExists('css', '#block-default-admin-content video > source');
    $expected_video_src = $file_url_generator->generate(\Drupal::token()->replace('public://[date:custom:Y]-[date:custom:m]/' . $test_filename_updated))->toString();
    $this->assertSame($expected_video_src, $video_element->getAttribute('src'));
  }
+1 −1
Changes for core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ protected function setUp(): void {

    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');

    $this->expectedLoggedErrors = 29;
    $this->expectedLoggedErrors = 31;
    // If saving the logs, then set the admin user.
    if ($this->outputLogs) {
      $this->migratedAdminUserName = 'admin';
+1 −1
Changes for core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7WithContentModerationTest.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ protected function setUp(): void {
    $type_plugin->setConfiguration($type_settings);
    $editorial->trustData()->save();

    $this->expectedLoggedErrors = 31;
    $this->expectedLoggedErrors = 33;
  }

  /**
+1 −1
Changes for core/modules/navigation/tests/src/Nightwatch/Tests/a11yTest.js: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ const navigationTest = {
    browser.drupalUninstall();
  },
};
const testCases = [{ name: 'Claro page', path: '/user/1/edit' }];
const testCases = [{ name: 'Default Admin page', path: '/user/1/edit' }];

testCases.forEach((testCase) => {
  navigationTest[`Accessibility - Navigation Module - ${testCase.name}`] = (
Loading