Skip to content

Commit 2484002

Browse files
committed
NotificationStoreTests: Simplifies Test
1 parent 3d02ebb commit 2484002

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Yosemite/YosemiteTests/Stores/NotificationStoreTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,16 @@ class NotificationStoreTests: XCTestCase {
332332

333333
network.simulateResponse(requestUrlSuffix: "notifications/read", filename: "generic_success")
334334

335-
let action = NotificationAction.updateMultipleReadStatus(noteIds: [originalNote.noteId], read: true) { [weak self] (error) in
336-
let storageNote = self?.viewStorage.loadNotification(noteID: originalNote.noteId)
337-
XCTAssertEqual(storageNote?.toReadOnly().read, expectedNote.read)
335+
// Mark as Read
336+
let action = NotificationAction.updateMultipleReadStatus(noteIds: [originalNote.noteId], read: true) { error in
338337
XCTAssertNil(error)
339338

339+
let reloadedNote = self.viewStorage.loadNotification(noteID: originalNote.noteId)?.toReadOnly()
340+
XCTAssertEqual(reloadedNote?.read, expectedNote.read)
340341
expectation.fulfill()
341342
}
342343

344+
// Insert the Note
343345
XCTAssertEqual(viewStorage.countObjects(ofType: Storage.Note.self), 0)
344346
noteStore.updateLocalNotes(with: [originalNote]) { [weak self] in
345347
XCTAssertEqual(self?.viewStorage.countObjects(ofType: Storage.Note.self), 1)

0 commit comments

Comments
 (0)