From 0140543f690844f4d036c516770baf7735a8ec6f Mon Sep 17 00:00:00 2001 From: Tomas Strba Date: Mon, 9 Dec 2024 10:06:50 +0100 Subject: [PATCH] Test rafactored based on the behavior of the BookmarkList --- UnitTests/Bookmarks/Model/BookmarkListTests.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/UnitTests/Bookmarks/Model/BookmarkListTests.swift b/UnitTests/Bookmarks/Model/BookmarkListTests.swift index 688a6da30a..97cfab6edd 100644 --- a/UnitTests/Bookmarks/Model/BookmarkListTests.swift +++ b/UnitTests/Bookmarks/Model/BookmarkListTests.swift @@ -249,7 +249,7 @@ final class BookmarkListTests: XCTestCase { XCTAssertEqual(items?.first?.isFavorite, newIsFavorite) } - func testWhenMultipleBookmarksWithSameURLDifferentCasesAreInserted_ThenLowercasedItemsDictContainsFirstOne() { + func testWhenMultipleBookmarksWithSameURLDifferentCasesAreInserted_ThenLowercasedItemsDictContainsOneOfThem() { var bookmarkList = BookmarkList() let bookmark1 = Bookmark(id: UUID().uuidString, url: "www.Example.com", title: "Example 1", isFavorite: true) @@ -262,8 +262,7 @@ final class BookmarkListTests: XCTestCase { let items = bookmarkList.lowercasedItemsDict[lowercasedKey] XCTAssertNotNil(items) - XCTAssertTrue(items?.contains(where: { $0.id == bookmark1.id }) ?? false) - XCTAssertFalse(items?.contains(where: { $0.id == bookmark2.id }) ?? false) + XCTAssert(items?.contains(where: { $0.id == bookmark1.id || $0.id == bookmark2.id}) ?? false) } }