Skip to content

Commit

Permalink
Remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Nov 15, 2024
1 parent f4e561f commit 6f712d3
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions WordPress/WordPressTest/ReaderTopicServiceTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,40 +305,6 @@ final class ReaderTopicSwiftTest: CoreDataTestCase {
}
}

/**
Ensure that a default topic can be set and retrieved.
*/
func testGettingSettingCurrentTopic() {
let remoteTopics = remoteAndDefaultTopicForTests()

// Setup
let expect = expectation(description: "topics saved expectation")
let service = ReaderTopicService(coreDataStack: contextManager)
service.setCurrentTopic(nil)

// Current topic is not nil after a sync
service.mergeMenuTopics(remoteTopics, withSuccess: { () -> Void in
expect.fulfill()
})
waitForExpectations(timeout: expectationTimeout, handler: nil)

XCTAssertNotNil(service.currentTopic, "The current topic was nil.")

let sortDescriptor = NSSortDescriptor(key: "title", ascending: true)
let request = NSFetchRequest<NSFetchRequestResult>(entityName: ReaderAbstractTopic.classNameWithoutNamespaces())
request.sortDescriptors = [sortDescriptor]

let results = try! mainContext.fetch(request)

var topic = results.last as! ReaderAbstractTopic
XCTAssertEqual(service.currentTopic(in: mainContext).type, ReaderDefaultTopic.TopicType, "The curent topic should have been a default topic")

topic = results.first as! ReaderAbstractTopic
service.setCurrentTopic(topic)

XCTAssertEqual(service.currentTopic(in: mainContext).path, topic.path, "The current topic did not match the topic we assiged to it")
}

/**
Ensure all topics are deleted when an account is changed.
*/
Expand Down

0 comments on commit 6f712d3

Please sign in to comment.