Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* [*] Experimental editor: Support Lockdown Mode, upload large photos and videos without running out of memory, and start new posts from their post type's template [#26365]
* [**] Experimental editor: Apply your Media settings to uploaded photos and videos, including image size, quality, video resolution, and location removal [#26367]
* [*] Reader: Show icons for more sites, and load a site's icon again after a failed attempt [#26393]
* [**] Reader: Saved posts are now kept in your WordPress.com account and sync across your devices. Posts saved on this device move to your account [#26372]


27.4
Expand Down
21 changes: 20 additions & 1 deletion Tests/KeystoneTests/Tests/Reader/ReaderDetailToolbarTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,26 @@ struct ReaderDetailToolbarTests {

let labels = buttons(in: viewController.toolbarItems).map(\.accessibilityLabel)
#expect(labels.contains("Reblog post") == showsReblog)
#expect(labels.count == (showsReblog ? 2 : 1)) // Save, and reblog when shown
// Save when signed in, and reblog when shown.
#expect(labels.count == (isLoggedIn ? 1 : 0) + (showsReblog ? 1 : 0))
}

@Test("the save button is hidden when signed out, because saved posts are kept in the account")
func saveButtonNeedsAnAccount() throws {
let context = ContextManager.forTesting().mainContext
let post = ReaderPostBuilder(context).build()
post.isLikesEnabled = true
post.commentsOpen = false
post.commentCount = 0
let viewController = UIViewController()
let toolbar = ReaderDetailToolbar(isLoggedIn: { false })

toolbar.configure(for: post, in: viewController)

let items = try #require(viewController.toolbarItems)
let labels = buttons(in: items).map(\.accessibilityLabel)
#expect(labels.count == 1) // Like only
#expect(items.first?.customView == nil) // A space first, so like stays on the right
}

@Test("a frosted capsule fits its buttons after a count changes width")
Expand Down
Loading