-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash: duplicate items when rendering payment methods list (#1842)
Replicates #1840 for v4 <youtrack>COIOS-800</youtrack>
- Loading branch information
Showing
5 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import XCTest | ||
@testable @_spi(AdyenInternal) import Adyen | ||
|
||
final class ListItemTests: XCTestCase { | ||
// Checks COIOS-797: NSInternalInconsistencyException 1008: Item identifiers are not unique | ||
private let imageURL = URL(string: "https://image.url")! | ||
|
||
func test_listItem_isAlwaysUnique() { | ||
let item1 = ListItem(title: "Test title 11", imageURL: imageURL, trailingText: "Text") | ||
let item2 = ListItem(title: "Test title 11", imageURL: imageURL, trailingText: "Text") | ||
|
||
XCTAssertNotEqual(item1, item2, "Items used for UITableView sections should be unique even if visually they are identical") | ||
XCTAssertNotEqual(item1.hashValue, item2.hashValue, "Items hashValues used for UITableViewDiffableDataSource should be unique even if visually they are identical") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters