         // ...and we should mark a 15 digit number as incomplete
         XCTAssertEqual(
             configuration.simulateValidationState(unionPay19_but_16_digits_entered.stp_safeSubstring(to: 15)),
-            .invalid(TextFieldElement.PANConfiguration.Error.incomplete)
+            .invalid(error: TextFieldElement.PANConfiguration.Error.incomplete, shouldDisplay: true)
         )
         
         // ...and load the BIN range.

        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] = [
            // 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),
            "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),

            // Test expired dates
            "12/21": .invalid(Error.invalid),
            "01/22": .invalid(Error.invalid),
            dateFormatter.string(from: oneMonthAgo!): .invalid(Error.invalid),
        ]
        let configuration = TextFieldElement.ExpiryDateConfiguration()
        for (text, expected) in testcases {


extension TextFieldElementConfiguration {
    // MARK: - Helpers
    func simulateValidationState(_ input: String) -> ElementValidationState {
        let textFieldElement = TextFieldElement(configuration: self)
        textFieldElement.textFieldView.textField.text = input
        textFieldElement.textFieldView.textDidChange()
        return textFieldElement.validationState
    }
}

extension ElementValidationState: Equatable {
    /// - Note: Assumes errors are equal if their localized descriptions are equal
    public static func == (lhs: ElementValidationState, rhs: ElementValidationState) -> Bool {
        switch (lhs, rhs) {
        case (.valid, .valid):
            return true
        case (let .invalid(lhs_error, lhs_shouldDisplay), let .invalid(rhs_error, rhs_shouldDisplay)):
            return lhs_error.localizedDescription == rhs_error.localizedDescription && lhs_shouldDisplay == rhs_shouldDisplay
        default:
            return false
        }
    }
}
