From 2766e86596d492d92fc65a1b17d7ca9ef5706bf2 Mon Sep 17 00:00:00 2001
From: Aaron Bauman <aaron@messageagency.com>
Date: Thu, 15 Feb 2024 16:14:46 -0500
Subject: [PATCH] Do not use translation in unit test selectors

---
 .../src/Tests/SalesforceMappingCrudFormTest.php    | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
index 98c4244d..44f96515 100644
--- a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
+++ b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php
@@ -12,8 +12,6 @@ use Drupal\Tests\BrowserTestBase;
  */
 class SalesforceMappingCrudFormTest extends BrowserTestBase {
 
-  use StringTranslationTrait;
-
   /**
    * Default theme required for D9.
    *
@@ -73,9 +71,9 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase {
       'drupal_bundle' => 'salesforce_mapping_test_content',
       'salesforce_object_type' => 'Contact',
     ];
-    $this->submitForm($post, $this->t('Save'));
+    $this->submitForm($post, 'Save');
     $this->assertSession()
-      ->pageTextContainsOnce($this->t('The mapping has been successfully saved.'));
+      ->pageTextContainsOnce('The mapping has been successfully saved.');
 
     $mapping = $mappingStorage->load($mapping_name);
     // Make sure mapping was saved correctly.
@@ -92,7 +90,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase {
       'drupal_bundle' => 'salesforce_mapping_test_content',
       'salesforce_object_type' => 'Contact',
     ];
-    $this->submitForm($post, $this->t('Save'));
+    $this->submitForm($post, 'Save');
     $this->assertSession()->fieldValueEquals('label', $post['label']);
 
     // Test simply adding a field plugin of every possible type. This is not
@@ -108,7 +106,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase {
       if (call_user_func([$definition['class'], 'isAllowed'], $mapping)) {
         // Add a new field:
         $post['buttons[field_type]'] = $definition['id'];
-        $this->submitForm($post, $this->t('Add a field mapping'));
+        $this->submitForm($post, 'Add a field mapping');
         // Confirm that the new field shows up:
         $this->assertSession()->pageTextContains($definition['label']);
 
@@ -141,9 +139,9 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase {
     }
 
     // Confirm that form saves correctly.
-    $this->submitForm($post, $this->t('Save'));
+    $this->submitForm($post, 'Save');
     $this->assertSession()
-      ->pageTextContainsOnce($this->t('The mapping has been successfully saved.'));
+      ->pageTextContainsOnce('The mapping has been successfully saved.');
 
     // Confirm that the changes are stored properly by reloading and counting
     // the fields.
-- 
GitLab