From 572c5a082405c1fc8006ed7672affd656b38b894 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 15 Dec 2024 13:52:26 -0500 Subject: [PATCH] Fix NotificationGroupTests not compiling --- .../NotificationGroupTests.swift | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Packages/Pachyderm/Tests/PachydermTests/NotificationGroupTests.swift b/Packages/Pachyderm/Tests/PachydermTests/NotificationGroupTests.swift index aa079875..0c83834f 100644 --- a/Packages/Pachyderm/Tests/PachydermTests/NotificationGroupTests.swift +++ b/Packages/Pachyderm/Tests/PachydermTests/NotificationGroupTests.swift @@ -197,72 +197,72 @@ class NotificationGroupTests: XCTestCase { func testGroupSimple() { let groups = NotificationGroup.createGroups(notifications: [likeA1, likeA2], only: [.favourite]) - XCTAssertEqual(groups, [NotificationGroup(notifications: [likeA1, likeA2])!]) + XCTAssertEqual(groups, [NotificationGroup(notifications: [likeA1, likeA2], kind: .favourite)!]) } func testGroupWithOtherGroupableInBetween() { let groups = NotificationGroup.createGroups(notifications: [likeA1, likeB, likeA2], only: [.favourite]) XCTAssertEqual(groups, [ - NotificationGroup(notifications: [likeA1, likeA2])!, - NotificationGroup(notifications: [likeB])!, + NotificationGroup(notifications: [likeA1, likeA2], kind: .favourite)!, + NotificationGroup(notifications: [likeB], kind: .favourite)!, ]) } func testDontGroupWithUngroupableInBetween() { let groups = NotificationGroup.createGroups(notifications: [likeA1, mentionB, likeA2], only: [.favourite]) XCTAssertEqual(groups, [ - NotificationGroup(notifications: [likeA1])!, - NotificationGroup(notifications: [mentionB])!, - NotificationGroup(notifications: [likeA2])!, + NotificationGroup(notifications: [likeA1], kind: .favourite)!, + NotificationGroup(notifications: [mentionB], kind: .mention)!, + NotificationGroup(notifications: [likeA2], kind: .favourite)!, ]) } func testMergeSimpleGroups() { - let group1 = NotificationGroup(notifications: [likeA1])! - let group2 = NotificationGroup(notifications: [likeA2])! + let group1 = NotificationGroup(notifications: [likeA1], kind: .favourite)! + let group2 = NotificationGroup(notifications: [likeA2], kind: .favourite)! let merged = NotificationGroup.mergeGroups(first: [group1], second: [group2], only: [.favourite]) XCTAssertEqual(merged, [ - NotificationGroup(notifications: [likeA1, likeA2])! + NotificationGroup(notifications: [likeA1, likeA2], kind: .favourite)! ]) } func testMergeGroupsWithOtherGroupableInBetween() { - let group1 = NotificationGroup(notifications: [likeA1])! - let group2 = NotificationGroup(notifications: [likeB])! - let group3 = NotificationGroup(notifications: [likeA2])! + let group1 = NotificationGroup(notifications: [likeA1], kind: .favourite)! + let group2 = NotificationGroup(notifications: [likeB], kind: .favourite)! + let group3 = NotificationGroup(notifications: [likeA2], kind: .favourite)! let merged = NotificationGroup.mergeGroups(first: [group1, group2], second: [group3], only: [.favourite]) XCTAssertEqual(merged, [ - NotificationGroup(notifications: [likeA1, likeA2])!, - NotificationGroup(notifications: [likeB])!, + NotificationGroup(notifications: [likeA1, likeA2], kind: .favourite)!, + NotificationGroup(notifications: [likeB], kind: .favourite)!, ]) let merged2 = NotificationGroup.mergeGroups(first: [group1], second: [group2, group3], only: [.favourite]) XCTAssertEqual(merged2, [ - NotificationGroup(notifications: [likeA1, likeA2])!, - NotificationGroup(notifications: [likeB])!, + NotificationGroup(notifications: [likeA1, likeA2], kind: .favourite)!, + NotificationGroup(notifications: [likeB], kind: .favourite)!, ]) - let group4 = NotificationGroup(notifications: [likeB2])! - let group5 = NotificationGroup(notifications: [mentionB])! + let group4 = NotificationGroup(notifications: [likeB2], kind: .favourite)! + let group5 = NotificationGroup(notifications: [mentionB], kind: .mention)! let merged3 = NotificationGroup.mergeGroups(first: [group1, group5, group2], second: [group4, group3], only: [.favourite]) print(merged3.count) XCTAssertEqual(merged3, [ group1, group5, - NotificationGroup(notifications: [likeB, likeB2]), + NotificationGroup(notifications: [likeB, likeB2], kind: .favourite), group3 ]) } func testDontMergeWithUngroupableInBetween() { - let group1 = NotificationGroup(notifications: [likeA1])! - let group2 = NotificationGroup(notifications: [mentionB])! - let group3 = NotificationGroup(notifications: [likeA2])! + let group1 = NotificationGroup(notifications: [likeA1], kind: .favourite)! + let group2 = NotificationGroup(notifications: [mentionB], kind: .mention)! + let group3 = NotificationGroup(notifications: [likeA2], kind: .favourite)! let merged = NotificationGroup.mergeGroups(first: [group1, group2], second: [group3], only: [.favourite]) XCTAssertEqual(merged, [ - NotificationGroup(notifications: [likeA1])!, - NotificationGroup(notifications: [mentionB])!, - NotificationGroup(notifications: [likeA2])!, + NotificationGroup(notifications: [likeA1], kind: .favourite)!, + NotificationGroup(notifications: [mentionB], kind: .mention)!, + NotificationGroup(notifications: [likeA2], kind: .favourite)!, ]) }