diff --git a/BitwardenShared/Core/Vault/Models/Enum/BankAccountTypeTests.swift b/BitwardenShared/Core/Vault/Models/Enum/BankAccountTypeTests.swift index fd7854e7dd..0f6a29cc31 100644 --- a/BitwardenShared/Core/Vault/Models/Enum/BankAccountTypeTests.swift +++ b/BitwardenShared/Core/Vault/Models/Enum/BankAccountTypeTests.swift @@ -1,3 +1,4 @@ +import BitwardenResources import Foundation import Testing @@ -6,6 +7,13 @@ import Testing struct BankAccountTypeTests { // MARK: Tests + /// `defaultValueLocalizedName` is the localized `Select` placeholder shown when no account + /// type is selected. + @Test + func defaultValueLocalizedName_isSelect() { + #expect(BankAccountType.defaultValueLocalizedName == Localizations.select) + } + /// Raw values match the server contract. @Test func rawValues_matchServerContract() { diff --git a/BitwardenShared/Core/Vault/Models/Enum/TitleType.swift b/BitwardenShared/Core/Vault/Models/Enum/TitleType.swift index 1a2854574f..f251700ef9 100644 --- a/BitwardenShared/Core/Vault/Models/Enum/TitleType.swift +++ b/BitwardenShared/Core/Vault/Models/Enum/TitleType.swift @@ -26,9 +26,9 @@ enum TitleType: String, Codable, Equatable, Hashable, Menuable { // MARK: Type Properties - /// default state title for title type + /// The default placeholder shown when no title is selected. static var defaultValueLocalizedName: String { - "--\(Localizations.select)--" + Localizations.select } var localizedName: String { diff --git a/BitwardenShared/Core/Vault/Models/Enum/TitleTypeTests.swift b/BitwardenShared/Core/Vault/Models/Enum/TitleTypeTests.swift new file mode 100644 index 0000000000..cefbc9d200 --- /dev/null +++ b/BitwardenShared/Core/Vault/Models/Enum/TitleTypeTests.swift @@ -0,0 +1,15 @@ +import BitwardenResources +import Testing + +@testable import BitwardenShared + +struct TitleTypeTests { + // MARK: Tests + + /// `defaultValueLocalizedName` is the localized `Select` placeholder shown when no title is + /// selected. + @Test + func defaultValueLocalizedName_isSelect() { + #expect(TitleType.defaultValueLocalizedName == Localizations.select) + } +} diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditBankAccountItem/AddEditBankAccountItemState.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditBankAccountItem/AddEditBankAccountItemState.swift index afe35e3bac..c5fa43cba1 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditBankAccountItem/AddEditBankAccountItemState.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditBankAccountItem/AddEditBankAccountItemState.swift @@ -51,7 +51,7 @@ protocol AddEditBankAccountItemState: Equatable, Sendable { extension BankAccountType: Menuable { /// The default placeholder shown when no account type is selected. public static var defaultValueLocalizedName: String { - "--\(Localizations.select)--" + Localizations.select } /// A localized string representation of the account type. diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift index 8f778e56fb..7bbba8c4e8 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponent.swift @@ -162,9 +162,9 @@ extension CardComponent.Brand { extension CardComponent.Brand: CaseIterable {} extension CardComponent.Brand: Menuable { - /// default state title for title type + /// The default placeholder shown when no card brand is selected. static var defaultValueLocalizedName: String { - "--\(Localizations.select)--" + Localizations.select } /// Provides a localized string representation of the card brand. @@ -290,9 +290,9 @@ extension CardComponent.Brand { extension CardComponent.Month: CaseIterable {} extension CardComponent.Month: Menuable { - /// default state title for title type + /// The default placeholder shown when no expiration month is selected. static var defaultValueLocalizedName: String { - "--\(Localizations.select)--" + Localizations.select } var localizedName: String { diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponentTests.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponentTests.swift index 8406361bae..08349e80e5 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponentTests.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditCardItem/CardComponentTests.swift @@ -10,6 +10,12 @@ import XCTest class CardComponentBrandTests: BitwardenTestCase { // MARK: Tests + /// `defaultValueLocalizedName` is the localized `Select` placeholder shown when no brand is + /// selected. + func test_defaultValueLocalizedName() { + XCTAssertEqual(CardComponent.Brand.defaultValueLocalizedName, Localizations.select) + } + /// `getter:icon` returns the appropriate icon for each card brand. func test_icon() { XCTAssertEqual(CardComponent.Brand.americanExpress.icon.name, SharedAsset.Icons.Cards.amex.name) @@ -280,3 +286,15 @@ class CardComponentBrandTests: BitwardenTestCase { XCTAssertEqual(CardComponent.Brand.visa.validDigitLengths, [13, 16, 19]) } } + +// MARK: - CardComponentMonthTests + +class CardComponentMonthTests: BitwardenTestCase { + // MARK: Tests + + /// `defaultValueLocalizedName` is the localized `Select` placeholder shown when no expiration + /// month is selected. + func test_defaultValueLocalizedName() { + XCTAssertEqual(CardComponent.Month.defaultValueLocalizedName, Localizations.select) + } +}