From 0f76c1928d43df6545f89ec5ebc6d6ea7fedda57 Mon Sep 17 00:00:00 2001 From: petruSt24 <126153378+petruSt24@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:18:58 +0300 Subject: [PATCH] Refactor FXIOS-7337 [v120] update copy and layout for the fakespot reliability card (#16577) * Refactor FXIOS-7337 [v119] update copy and layout for the fakespot reliability card (#16267) * updated FakespotReliabilityCardView as well * addressed PR comments * updated to semibolds in the FakespotReliabilityCardView * updated collapsible card title font weight * fix merge issue * moved PartnerWebsites and added the bold strings to localizations * updated bolded strings * renamed the MarkupAttributeUtility instance and moved the attributedString attribution to the view configuration method * removed redundant lines * replaced the font with the one added in the UX struct * Fix warning * Fix unit tests --------- Co-authored-by: Stefan Vladut Co-authored-by: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> --- .../CollapsibleCardView.swift | 4 +- Client.xcodeproj/project.pbxproj | 4 ++ .../Fakespot/Client/PartnerWebsites.swift | 36 +++++++++++++ .../Fakespot/FakespotOptInCardViewModel.swift | 31 ----------- .../Frontend/Fakespot/FakespotViewModel.swift | 1 + .../Views/FakespotReliabilityCardView.swift | 13 +++-- .../Views/FakespotReviewQualityCardView.swift | 54 +++++++++---------- Client/Frontend/Strings.swift | 18 +++---- .../FakespotOptInViewModelTests.swift | 8 +-- Tests/SharedTests/AsyncReducerTests.swift | 2 +- 10 files changed, 93 insertions(+), 78 deletions(-) create mode 100644 Client/Frontend/Fakespot/Client/PartnerWebsites.swift diff --git a/BrowserKit/Sources/ComponentLibrary/CollapsibleCardView.swift b/BrowserKit/Sources/ComponentLibrary/CollapsibleCardView.swift index f5719d49d9b5..db1fef1164b8 100644 --- a/BrowserKit/Sources/ComponentLibrary/CollapsibleCardView.swift +++ b/BrowserKit/Sources/ComponentLibrary/CollapsibleCardView.swift @@ -101,7 +101,9 @@ public class CollapsibleCardView: ShadowCardView, UIGestureRecognizerDelegate { lazy var titleLabel: UILabel = .build { label in label.adjustsFontForContentSizeCategory = true - label.font = DefaultDynamicFontHelper.preferredBoldFont(withTextStyle: .subheadline, size: 15.0) + label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline, + size: 15.0, + weight: .semibold) label.numberOfLines = 0 } diff --git a/Client.xcodeproj/project.pbxproj b/Client.xcodeproj/project.pbxproj index 7be665fd1a61..aa1ddf66372b 100644 --- a/Client.xcodeproj/project.pbxproj +++ b/Client.xcodeproj/project.pbxproj @@ -841,6 +841,7 @@ AB52ED3B2A0E8873001067F5 /* UserConversionMetrics.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB52ED3A2A0E8873001067F5 /* UserConversionMetrics.swift */; }; AB7D4C3129ACAED100626427 /* Tab+ChangeUserAgentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB7D4C3029ACAED100626427 /* Tab+ChangeUserAgentTests.swift */; }; ABB507CF2A136FB2009CAA67 /* UserConversionMetricsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABB507CD2A136FB2009CAA67 /* UserConversionMetricsTests.swift */; }; + ABE4393E2AC432040074FFE1 /* PartnerWebsites.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABE4393D2AC432040074FFE1 /* PartnerWebsites.swift */; }; ABEF80D12A24D2BE003F52C4 /* CreditCardBottomSheetViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEF80D02A24D2BE003F52C4 /* CreditCardBottomSheetViewModel.swift */; }; ABEF80D52A254185003F52C4 /* CreditCardBottomSheetFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEF80D42A254185003F52C4 /* CreditCardBottomSheetFooterView.swift */; }; ABEF80D92A2F283E003F52C4 /* CreditCardBottomSheetViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABEF80D82A2F283D003F52C4 /* CreditCardBottomSheetViewModelTests.swift */; }; @@ -5457,6 +5458,7 @@ AB7C4D658AB44D577390B61F /* an */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = an; path = an.lproj/Menu.strings; sourceTree = ""; }; AB7D4C3029ACAED100626427 /* Tab+ChangeUserAgentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Tab+ChangeUserAgentTests.swift"; sourceTree = ""; }; ABB507CD2A136FB2009CAA67 /* UserConversionMetricsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserConversionMetricsTests.swift; sourceTree = ""; }; + ABE4393D2AC432040074FFE1 /* PartnerWebsites.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerWebsites.swift; sourceTree = ""; }; ABEF80D02A24D2BE003F52C4 /* CreditCardBottomSheetViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardBottomSheetViewModel.swift; sourceTree = ""; }; ABEF80D42A254185003F52C4 /* CreditCardBottomSheetFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreditCardBottomSheetFooterView.swift; sourceTree = ""; }; ABEF80D82A2F283D003F52C4 /* CreditCardBottomSheetViewModelTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardBottomSheetViewModelTests.swift; sourceTree = ""; }; @@ -8751,6 +8753,7 @@ 8C92DE902A7128CB0090BD28 /* ProductAnalysisData.swift */, E1516A3D2A7BC07E007819A4 /* ReliabilityGrade.swift */, E18F44062A951C330056160F /* FakespotHighlightGroup.swift */, + ABE4393D2AC432040074FFE1 /* PartnerWebsites.swift */, ); path = Client; sourceTree = ""; @@ -12763,6 +12766,7 @@ EBC486992195F46B00CDA48D /* InternalSchemeHandler.swift in Sources */, E18BAAFD28E4A44500098AE2 /* TopTabFader.swift in Sources */, C8656D79270F866700E199EA /* CustomizeHomepageSectionCell.swift in Sources */, + ABE4393E2AC432040074FFE1 /* PartnerWebsites.swift in Sources */, C84655FB28879FC600861B4A /* WallpaperStorageUtility.swift in Sources */, 4347B39A298DA5BB0045F677 /* CreditCardInputViewModel.swift in Sources */, 6025B10D267B6C5400F59F6B /* LoginRecordExtension.swift in Sources */, diff --git a/Client/Frontend/Fakespot/Client/PartnerWebsites.swift b/Client/Frontend/Fakespot/Client/PartnerWebsites.swift new file mode 100644 index 000000000000..d8beb5e802e4 --- /dev/null +++ b/Client/Frontend/Fakespot/Client/PartnerWebsites.swift @@ -0,0 +1,36 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import Foundation + +public enum PartnerWebsite: String, CaseIterable { + case amazon + case walmart + case bestbuy + + var title: String { + switch self { + case .bestbuy: return "Best Buy" + default: return self.rawValue.capitalized + } + } + + var orderWebsites: [String] { + let currentPartnerWebsites = PartnerWebsite.allCases.map { $0.title } + + // make sure current website is first + var websitesOrder = currentPartnerWebsites.filter { $0 != self.title } + websitesOrder.insert(self.title, at: 0) + + return websitesOrder + } + + init?(for siteName: String?) { + guard let siteName = siteName, let partner = PartnerWebsite(rawValue: siteName) else { + return nil + } + + self = partner + } +} diff --git a/Client/Frontend/Fakespot/FakespotOptInCardViewModel.swift b/Client/Frontend/Fakespot/FakespotOptInCardViewModel.swift index 7d44bf0258a7..ac0fbd9b0346 100644 --- a/Client/Frontend/Fakespot/FakespotOptInCardViewModel.swift +++ b/Client/Frontend/Fakespot/FakespotOptInCardViewModel.swift @@ -14,37 +14,6 @@ struct FakespotOptInCardViewModel { static let bodyFirstParagraphLabelFontSize: CGFloat = 15 } - public enum PartnerWebsite: String, CaseIterable { - case amazon - case walmart - case bestbuy - - var title: String { - switch self { - case .bestbuy: return "Best Buy" - default: return self.rawValue.capitalized - } - } - - var orderWebsites: [String] { - let currentPartnerWebsites = PartnerWebsite.allCases.map { $0.title } - - // make sure current website is first - var websitesOrder = currentPartnerWebsites.filter { $0 != self.title } - websitesOrder.insert(self.title, at: 0) - - return websitesOrder - } - - init?(for siteName: String?) { - guard let siteName = siteName, let partner = PartnerWebsite(rawValue: siteName) else { - return nil - } - - self = partner - } - } - private let tabManager: TabManager private let prefs: Prefs let cardA11yId: String = AccessibilityIdentifiers.Shopping.OptInCard.card diff --git a/Client/Frontend/Fakespot/FakespotViewModel.swift b/Client/Frontend/Fakespot/FakespotViewModel.swift index 02f7caa3a41b..fa4a036f9c5f 100644 --- a/Client/Frontend/Fakespot/FakespotViewModel.swift +++ b/Client/Frontend/Fakespot/FakespotViewModel.swift @@ -231,6 +231,7 @@ class FakespotViewModel { profile: Profile = AppContainer.shared.resolve()) { self.shoppingProduct = shoppingProduct optInCardViewModel.productSitename = shoppingProduct.product?.sitename + reviewQualityCardViewModel.productSitename = shoppingProduct.product?.sitename self.prefs = profile.prefs } diff --git a/Client/Frontend/Fakespot/Views/FakespotReliabilityCardView.swift b/Client/Frontend/Fakespot/Views/FakespotReliabilityCardView.swift index 472d5d3710c1..e0a9a1f14d6e 100644 --- a/Client/Frontend/Fakespot/Views/FakespotReliabilityCardView.swift +++ b/Client/Frontend/Fakespot/Views/FakespotReliabilityCardView.swift @@ -24,7 +24,7 @@ class FakespotReliabilityCardView: UIView, ThemeApplicable { static let letterHorizontalPadding: CGFloat = 4 static let descriptionVerticalPadding: CGFloat = 6 static let descriptionHorizontalPadding: CGFloat = 8 - static let titleFontSize: CGFloat = 17 + static let titleFontSize: CGFloat = 15 static let letterFontSize: CGFloat = 13 static let descriptionFontSize: CGFloat = 13 static let descriptionBackgroundAlpha: CGFloat = 0.15 @@ -35,8 +35,9 @@ class FakespotReliabilityCardView: UIView, ThemeApplicable { private lazy var titleLabel: UILabel = .build { view in view.adjustsFontForContentSizeCategory = true - view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .headline, - size: UX.titleFontSize) + view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline, + size: UX.titleFontSize, + weight: .semibold) view.numberOfLines = 0 } @@ -51,14 +52,14 @@ class FakespotReliabilityCardView: UIView, ThemeApplicable { private lazy var reliabilityLetterLabel: UILabel = .build { view in view.adjustsFontForContentSizeCategory = true - view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, + view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .footnote, size: UX.letterFontSize, weight: .semibold) } private lazy var reliabilityDescriptionLabel: UILabel = .build { view in view.adjustsFontForContentSizeCategory = true - view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .caption1, size: UX.descriptionFontSize) + view.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .footnote, size: UX.descriptionFontSize) view.numberOfLines = 0 } @@ -90,6 +91,7 @@ class FakespotReliabilityCardView: UIView, ThemeApplicable { cardContainer.configure(cardModel) } + // MARK: Theming System func applyTheme(theme: Theme) { cardContainer.applyTheme(theme: theme) reliabilityScoreView.layer.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1).cgColor @@ -103,6 +105,7 @@ class FakespotReliabilityCardView: UIView, ThemeApplicable { } } + // MARK: Layout Setup private func setupLayout() { addSubview(cardContainer) diff --git a/Client/Frontend/Fakespot/Views/FakespotReviewQualityCardView.swift b/Client/Frontend/Fakespot/Views/FakespotReviewQualityCardView.swift index d454807747a8..1f27e6b6fd0e 100644 --- a/Client/Frontend/Fakespot/Views/FakespotReviewQualityCardView.swift +++ b/Client/Frontend/Fakespot/Views/FakespotReviewQualityCardView.swift @@ -9,9 +9,25 @@ import ComponentLibrary // MARK: View Model final class FakespotReviewQualityCardViewModel { + private struct UX { + static let labelFontSize: CGFloat = 15 + static let baseFont = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline, + size: UX.labelFontSize) + } + + let markupUtility = MarkupAttributeUtility(baseFont: UX.baseFont) private let tabManager: TabManager let fakespotLearnMoreLink = FakespotUtils.learnMoreUrl var dismissViewController: (() -> Void)? + var productSitename: String? + var highlightsText: NSAttributedString { + let currentPartner = PartnerWebsite(for: productSitename?.lowercased()) ?? .amazon + let highlightedWebsite = currentPartner.title + let plainText = String.localizedStringWithFormat(String.Shopping.ReviewQualityCardHighlightsLabel, highlightedWebsite) + let result = markupUtility.addAttributesTo(text: plainText) + + return result + } // MARK: Init init(tabManager: TabManager = AppContainer.shared.resolve()) { @@ -38,6 +54,8 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { static let labelFontSize: CGFloat = 15 static let ratingsFooterStackViewInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) static let contentStackViewInsets = UIEdgeInsets(top: 8, left: 8, bottom: 0, right: 8) + static let baseFont = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline, + size: UX.labelFontSize) } private var viewModel: FakespotReviewQualityCardViewModel? @@ -69,18 +87,14 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true label.clipsToBounds = true - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) + label.font = UX.baseFont } private lazy var subHeadlineLabel: UILabel = .build { label in - label.text = .Shopping.ReviewQualityCardSubHeadlineLabel label.accessibilityIdentifier = AccessibilityIdentifiers.Shopping.ReviewQualityCard.subHeadlineLabel label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true label.clipsToBounds = true - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) } private lazy var ratingsStackView: UIStackView = .build { stackView in @@ -126,8 +140,7 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true label.clipsToBounds = true - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) + label.font = UX.baseFont } private lazy var mixReliableReviewsLabel: UILabel = .build { label in @@ -136,8 +149,7 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true label.clipsToBounds = true - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) + label.font = UX.baseFont } private lazy var unreliableReviewsLabel: UILabel = .build { label in @@ -146,8 +158,7 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true label.clipsToBounds = true - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) + label.font = UX.baseFont } private lazy var footerStackView: UIStackView = .build { stackView in @@ -159,13 +170,6 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { } private lazy var adjustedRatingLabel: UILabel = .build { label in - let text = String.Shopping.ReviewQualityCardAdjustedRatingLabel - let normalFont = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) - let boldFont = DefaultDynamicFontHelper.preferredBoldFont(withTextStyle: .body, size: UX.labelFontSize) - label.attributedText = text.attributedText(boldPartsOfString: ["adjusted rating"], - initialFont: normalFont, - boldFont: boldFont) label.accessibilityIdentifier = AccessibilityIdentifiers.Shopping.ReviewQualityCard.adjustedRatingLabel label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true @@ -173,13 +177,6 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { } private lazy var highlightsLabel: UILabel = .build { label in - let text = String.Shopping.ReviewQualityCardHighlightsLabel - let normalFont = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) - let boldFont = DefaultDynamicFontHelper.preferredBoldFont(withTextStyle: .body, size: UX.labelFontSize) - label.attributedText = text.attributedText(boldPartsOfString: ["Highlights"], - initialFont: normalFont, - boldFont: boldFont) label.accessibilityIdentifier = AccessibilityIdentifiers.Shopping.ReviewQualityCard.highlightsLabel label.numberOfLines = 0 label.adjustsFontForContentSizeCategory = true @@ -194,8 +191,7 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { button.buttonEdgeSpacing = 0 button.titleLabel?.numberOfLines = 0 button.addTarget(self, action: #selector(self.didTapLearnMore), for: .touchUpInside) - button.titleLabel?.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, - size: UX.labelFontSize) + button.titleLabel?.font = UX.baseFont } override init(frame: CGRect) { @@ -268,6 +264,10 @@ final class FakespotReviewQualityCardView: UIView, Notifiable, ThemeApplicable { func configure(_ viewModel: FakespotReviewQualityCardViewModel) { self.viewModel = viewModel + highlightsLabel.attributedText = viewModel.highlightsText + subHeadlineLabel.attributedText = viewModel.markupUtility.addAttributesTo(text: String.Shopping.ReviewQualityCardSubHeadlineLabel) + adjustedRatingLabel.attributedText = viewModel.markupUtility.addAttributesTo(text: String.Shopping.ReviewQualityCardAdjustedRatingLabel) + let viewModel = CollapsibleCardViewModel( contentView: contentStackView, cardViewA11yId: AccessibilityIdentifiers.Shopping.ReviewQualityCard.card, diff --git a/Client/Frontend/Strings.swift b/Client/Frontend/Strings.swift index d30cf7fd33a7..66c5687a9b08 100644 --- a/Client/Frontend/Strings.swift +++ b/Client/Frontend/Strings.swift @@ -3798,17 +3798,17 @@ extension String { public static let ReviewQualityCardHeadlineLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.Headline.Label.v119 tableName: "Shopping", - value: "We use AI technology from Fakespot by Mozilla to analyze the reliability of product reviews. This analysis will only help you assess review quality, not product quality.", + value: "We use AI technology from Fakespot by Mozilla to check the reliability of product reviews. This will only help you assess review quality, not product quality.", comment: "Label of the headline from How we determine review quality card displayed in the shopping review quality bottom sheet.") public static let ReviewQualityCardSubHeadlineLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.SubHeadline.Label.v119 tableName: "Shopping", - value: "We assign each product’s reviews a letter grade from A to F.", - comment: "Label of the sub headline from How we determine review quality card displayed in the shopping review quality bottom sheet.") + value: "We assign each product’s reviews a *letter grade* from A to F.", + comment: "Label of the sub headline from How we determine review quality card displayed in the shopping review quality bottom sheet. The *text inside asterisks* denotes part of the string to bold, please leave the text inside the '*' so that it is bolded correctly.") public static let ReviewQualityCardReliableReviewsLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.ReliableReviews.Label.v119 tableName: "Shopping", - value: "We believe the reviews to be reliable", + value: "Reliable reviews. We believe the reviews are likely from real customers who left honest, unbiased reviews.", comment: "Reliable reviews label from How we determine review quality card displayed in the shopping review quality bottom sheet.") public static let ReviewQualityCardMixedReviewsLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.MixedReviews.Label.v119 @@ -3818,18 +3818,18 @@ extension String { public static let ReviewQualityCardUnreliableReviewsLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.UnreliableReviews.Label.v119 tableName: "Shopping", - value: "We believe the reviews are unreliable", + value: "Unreliable reviews. We believe the reviews are likely fake or from biased reviewers.", comment: "Unnreliable reviews label from How we determine review quality card displayed in the shopping review quality bottom sheet.") public static let ReviewQualityCardAdjustedRatingLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.AdjustedRating.Label.v119 tableName: "Shopping", - value: "The adjusted rating is based only on reviews we believe to be reliable.", - comment: "Adujusted rating label from How we determine review quality card displayed in the shopping review quality bottom sheet.") + value: "*The adjusted rating* is based only on reviews we believe to be reliable.", + comment: "Adujusted rating label from How we determine review quality card displayed in the shopping review quality bottom sheet. The *text inside asterisks* denotes part of the string to bold, please leave the text inside the '*' so that it is bolded correctly.") public static let ReviewQualityCardHighlightsLabel = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.Highlights.Label.v119 tableName: "Shopping", - value: "Highlights are from Amazon reviews within the last 80 days that we believe to be reliable.", - comment: "Highlights label from How we determine review quality card displayed in the shopping review quality bottom sheet.") + value: "*Highlights* are from %1@ reviews within the last 80 days that we believe to be reliable.", + comment: "Highlights label from How we determine review quality card displayed in the shopping review quality bottom sheet. The parameter substitutes the partner website the user is coming from. The *text inside asterisks* denotes part of the string to bold, please leave the text inside the '*' so that it is bolded correctly.") public static let ReviewQualityCardLearnMoreButtonTitle = MZLocalizedString( key: "", // Shopping.ReviewQualityCard.LearnMoreButton.Title.v119 tableName: "Shopping", diff --git a/Tests/ClientTests/Fakespot/FakespotOptInViewModelTests.swift b/Tests/ClientTests/Fakespot/FakespotOptInViewModelTests.swift index dab0ea55b0fc..6e20f4ab8299 100644 --- a/Tests/ClientTests/Fakespot/FakespotOptInViewModelTests.swift +++ b/Tests/ClientTests/Fakespot/FakespotOptInViewModelTests.swift @@ -27,18 +27,18 @@ final class FakespotOptInCardViewModelTests: XCTestCase { func testGetWebsites() { viewModel.productSitename = "bestbuy" var websites = viewModel.orderWebsites - XCTAssertEqual(websites[0], FakespotOptInCardViewModel.PartnerWebsite.bestbuy.title) + XCTAssertEqual(websites[0], PartnerWebsite.bestbuy.title) viewModel.productSitename = "amazon" websites = viewModel.orderWebsites - XCTAssertEqual(websites[0], FakespotOptInCardViewModel.PartnerWebsite.amazon.title) + XCTAssertEqual(websites[0], PartnerWebsite.amazon.title) viewModel.productSitename = "walmart" websites = viewModel.orderWebsites - XCTAssertEqual(websites[0], FakespotOptInCardViewModel.PartnerWebsite.walmart.title) + XCTAssertEqual(websites[0], PartnerWebsite.walmart.title) viewModel.productSitename = "randomShop" websites = viewModel.orderWebsites - XCTAssertEqual(websites[0], FakespotOptInCardViewModel.PartnerWebsite.amazon.title) // as "Amazon" is the default + XCTAssertEqual(websites[0], PartnerWebsite.amazon.title) // as "Amazon" is the default } } diff --git a/Tests/SharedTests/AsyncReducerTests.swift b/Tests/SharedTests/AsyncReducerTests.swift index 08fd782d0e59..6df08bd21706 100644 --- a/Tests/SharedTests/AsyncReducerTests.swift +++ b/Tests/SharedTests/AsyncReducerTests.swift @@ -85,7 +85,7 @@ class AsyncReducerTests: XCTestCase { // Pretend that some new work arrived while we were handling this. if let nextUp = addDuring.popLast() { - _ = XCTAssertNoThrow(try reducer.append(nextUp)) + XCTAssertNoThrow(try reducer.append(nextUp)) } return deferMaybe(out)