@@ -40,11 +40,13 @@ class BlogDashboardServiceTests: XCTestCase {
4040 // The id is posts
4141 XCTAssertEqual ( snapshot. itemIdentifiers ( inSection: draftsSection!) . first? . id, . posts)
4242
43- // For Drafts section, scheduled has 0 posts
44- XCTAssertEqual ( ( snapshot. itemIdentifiers ( inSection: draftsSection!) . first? . cellViewModel ? [ " scheduled " ] as? [ Any ] ) ? . count, 0 )
43+ // For Drafts section
44+ XCTAssertFalse ( snapshot. itemIdentifiers ( inSection: draftsSection!) . first? . cellViewModel ? [ " show_scheduled " ] as! Bool )
45+ XCTAssertTrue ( snapshot. itemIdentifiers ( inSection: draftsSection!) . first? . cellViewModel ? [ " show_drafts " ] as! Bool )
4546
46- // For Scheduled, draft has 0 posts
47- XCTAssertEqual ( ( snapshot. itemIdentifiers ( inSection: scheduledSection!) . first? . cellViewModel ? [ " draft " ] as? [ Any ] ) ? . count, 0 )
47+ // For Scheduled section
48+ XCTAssertFalse ( snapshot. itemIdentifiers ( inSection: scheduledSection!) . first? . cellViewModel ? [ " show_drafts " ] as! Bool )
49+ XCTAssertTrue ( snapshot. itemIdentifiers ( inSection: scheduledSection!) . first? . cellViewModel ? [ " show_scheduled " ] as! Bool )
4850 expect. fulfill ( )
4951 }
5052
@@ -63,11 +65,11 @@ class BlogDashboardServiceTests: XCTestCase {
6365 // The item identifier id is posts
6466 XCTAssertEqual ( snapshot. itemIdentifiers ( inSection: draftsSection. first!) . first? . id, . posts)
6567
66- // For Drafts section, scheduled has 0 posts
67- XCTAssertEqual ( ( snapshot. itemIdentifiers ( inSection: draftsSection. first!) . first? . cellViewModel ? [ " scheduled " ] as? [ Any ] ) ? . count , 0 )
68+ // For Drafts section, showScheduled is nil
69+ XCTAssertFalse ( snapshot. itemIdentifiers ( inSection: draftsSection. first!) . first? . cellViewModel ? [ " show_scheduled " ] as! Bool )
6870
6971 // For Drafts section, scheduled has 1 post
70- XCTAssertEqual ( ( snapshot. itemIdentifiers ( inSection: draftsSection. first!) . first? . cellViewModel ? [ " draft " ] as? [ Any ] ) ? . count , 1 )
72+ XCTAssertTrue ( snapshot. itemIdentifiers ( inSection: draftsSection. first!) . first? . cellViewModel ? [ " show_drafts " ] as! Bool )
7173
7274 expect. fulfill ( )
7375 }
0 commit comments