         let oneMonthFromNow = Calendar.current.date(byAdding: .month, value: 1, to: firstDayOfThisMonth!)
         let oneYearFromNow = Calendar.current.date(byAdding: .year, value: 1, to: firstDayOfThisMonth!)
         
-        let testcases: [String: TextFieldElement.ValidationState] = [
+        let testcases: [String: ElementValidationState] = [
             // Test empty -> incomplete -> complete
-            "": .invalid(TextFieldElement.Error.empty),
-            "0": .invalid(Error.incomplete),
-            "1": .invalid(Error.incomplete),
-            "12": .invalid(Error.incomplete),
-            "12/2": .invalid(Error.incomplete),
+            "": .invalid(error: TextFieldElement.Error.empty, shouldDisplay: false),
+            "0": .invalid(error: Error.incomplete, shouldDisplay: true),
+            "1": .invalid(error: Error.incomplete, shouldDisplay: true),
+            "12": .invalid(error: Error.incomplete, shouldDisplay: true),
+            "12/2": .invalid(error: Error.incomplete, shouldDisplay: true),
             "12/49": .valid,
             dateFormatter.string(from: oneYearFromNow!): .valid,
             dateFormatter.string(from: oneMonthFromNow!): .valid,
             
             // Test invalid months
-            "00": .invalid(Error.invalidMonth),
-            "00/9": .invalid(Error.invalidMonth),
-            "00/99": .invalid(Error.invalidMonth),
-            "13": .invalid(Error.invalidMonth),
+            "00": .invalid(error: Error.invalidMonth, shouldDisplay: true),
+            "00/9": .invalid(error: Error.invalidMonth, shouldDisplay: true),
+            "00/99": .invalid(error: Error.invalidMonth, shouldDisplay: true),
+            "13": .invalid(error: Error.invalidMonth, shouldDisplay: true),
 
             // Test expired dates
-            "12/21": .invalid(Error.invalid),
-            "01/22": .invalid(Error.invalid),
-            dateFormatter.string(from: oneMonthAgo!): .invalid(Error.invalid),
+            "12/21": .invalid(error: Error.invalid, shouldDisplay: true),
+            "01/22": .invalid(error: Error.invalid, shouldDisplay: true),
+            dateFormatter.string(from: oneMonthAgo!): .invalid(error: Error.invalid, shouldDisplay: true),
         ]
         let configuration = TextFieldElement.ExpiryDateConfiguration()
         for (text, expected) in testcases {

        // ...a 16 digit number should be considered incomplete
        XCTAssertEqual(
            configuration.simulateValidationState(unionPay19_but_16_digits_entered),
            .invalid(TextFieldElement.PANConfiguration.Error.incomplete)
        )
        // ...and the 19 digit number should still be valid
        XCTAssertEqual(

class TextFieldElementCardTest: XCTestCase {
    func testPANValidation() throws {
        typealias Error = TextFieldElement.PANConfiguration.Error
        let testcases: [String: ElementValidationState] = [
            "": .invalid(error: Error.empty, shouldDisplay: false),
            
            // Incomplete
            "4": .invalid(error: Error.incomplete, shouldDisplay: true),
            "424242424242": .invalid(error: Error.incomplete, shouldDisplay: true),
            "3622720627166" : .invalid(error: Error.incomplete, shouldDisplay: true),  // diners club (14 digit, but 13 digits given)
            
            // Unknown card brand
            "0000000000000000": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            "1000000000000000": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            "1234567812345678": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            "9999999999999995": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            "1234123412341234": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            "9999999999999999999999": .invalid(error: Error.invalidBrand, shouldDisplay: true),
            
            // Fails luhn check
            "4012888888881889": .invalid(error: Error.invalidLuhn, shouldDisplay: true),
            "2223000010089809": .invalid(error: Error.invalidLuhn, shouldDisplay: true),
            "3530111333300009": .invalid(error: Error.invalidLuhn, shouldDisplay: true),
            "5105105105105109": .invalid(error: Error.invalidLuhn, shouldDisplay: true), // mastercard (prepaid)
            "6011111111111119": .invalid(error: Error.invalidLuhn, shouldDisplay: true), // discover
            "6200000000000009": .invalid(error: Error.invalidLuhn, shouldDisplay: true), // cup

            // Valid (luhn-passing) PANs
            "4012888888881881": .valid,
