From 6eaddbafe7128248ddba2f5e16cf2c1ae892644e Mon Sep 17 00:00:00 2001 From: Isabella Date: Tue, 27 Aug 2024 13:19:42 -0600 Subject: [PATCH] Refactor FXIOS-9719 Update Twitter name String to X (#21630) * Update the "Twitter" title for the Default Suggested Tile to contain X (new name). * Fix UI test. * Update firefox-ios/Client/Frontend/Strings.swift Co-authored-by: roux g. buciu <11182210+adudenamedruby@users.noreply.github.com> * Test fix. --------- Co-authored-by: roux g. buciu <11182210+adudenamedruby@users.noreply.github.com> --- firefox-ios/Client/Frontend/Strings.swift | 5 +++++ firefox-ios/Storage/DefaultSuggestedSites.swift | 2 +- .../Tests/XCUITests/ActivityStreamTest.swift | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/firefox-ios/Client/Frontend/Strings.swift b/firefox-ios/Client/Frontend/Strings.swift index 7025020f71f6..8044752a8d9a 100644 --- a/firefox-ios/Client/Frontend/Strings.swift +++ b/firefox-ios/Client/Frontend/Strings.swift @@ -6791,6 +6791,11 @@ extension String { tableName: nil, value: nil, comment: "Tile title for Twitter") + public static let DefaultSuggestedX = MZLocalizedString( + key: "SuggestedSites.X.Title.v131", + tableName: "SuggestedSites", + value: "X", + comment: "Title for X (formerly Twitter) tile in the suggested sites section of the homepage.") } // MARK: - Credential Provider diff --git a/firefox-ios/Storage/DefaultSuggestedSites.swift b/firefox-ios/Storage/DefaultSuggestedSites.swift index 4dcc769c583b..cec47fcb189e 100644 --- a/firefox-ios/Storage/DefaultSuggestedSites.swift +++ b/firefox-ios/Storage/DefaultSuggestedSites.swift @@ -73,7 +73,7 @@ open class DefaultSuggestedSites { imageUrl: "asset://suggestedsites_twitter", faviconUrl: "asset://defaultFavicon", trackingId: 628, - title: .DefaultSuggestedTwitter + title: .DefaultSuggestedX ) ], "zh_CN": [ diff --git a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift index e3f234fee875..1800d4e76614 100644 --- a/firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift +++ b/firefox-ios/firefox-ios-tests/Tests/XCUITests/ActivityStreamTest.swift @@ -10,7 +10,7 @@ let newTopSite = [ "topSiteLabel": "Mozilla", "bookmarkLabel": "Internet for people, not profit — Mozilla (US)" ] -let allDefaultTopSites = ["Facebook", "YouTube", "Amazon", "Wikipedia", "Twitter"] +let allDefaultTopSites = ["Facebook", "YouTube", "Amazon", "Wikipedia", "X"] class ActivityStreamTest: BaseTestCase { typealias TopSites = AccessibilityIdentifiers.FirefoxHomepage.TopSites @@ -53,7 +53,7 @@ class ActivityStreamTest: BaseTestCase { // There should be 5 top sites by default checkNumberOfExpectedTopSites(numberOfExpectedTopSites: 5) // Check their names so that test is added to Smoketest - mozWaitForElementToExist(app.collectionViews.cells.staticTexts["Twitter"]) + mozWaitForElementToExist(app.collectionViews.cells.staticTexts["X"]) mozWaitForElementToExist(app.collectionViews.cells.staticTexts["Amazon"]) mozWaitForElementToExist(app.collectionViews.cells.staticTexts["Wikipedia"]) mozWaitForElementToExist(app.collectionViews.cells.staticTexts["YouTube"])