mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Removed Pill Avatar + @room is not displayed among suggestions for DM (#1968)
* removed pill avatar * completion suggestion service shows @room as first and only if not a DM * code improvement
This commit is contained in:
@@ -102,9 +102,9 @@ final class CompletionSuggestionServiceTests: XCTestCase {
|
||||
try await deferred.fulfill()
|
||||
|
||||
deferred = deferFulfillment(service.suggestionsPublisher) { suggestions in
|
||||
suggestions == [.user(item: .init(id: alice.userID, displayName: alice.displayName, avatarURL: alice.avatarURL)),
|
||||
.user(item: .init(id: bob.userID, displayName: bob.displayName, avatarURL: bob.avatarURL)),
|
||||
.allUsers(item: .allUsersMention(roomAvatar: nil))]
|
||||
suggestions == [.allUsers(item: .allUsersMention(roomAvatar: nil)),
|
||||
.user(item: .init(id: alice.userID, displayName: alice.displayName, avatarURL: alice.avatarURL)),
|
||||
.user(item: .init(id: bob.userID, displayName: bob.displayName, avatarURL: bob.avatarURL))]
|
||||
}
|
||||
service.setSuggestionTrigger(.init(type: .user, text: ""))
|
||||
try await deferred.fulfill()
|
||||
|
||||
@@ -37,9 +37,6 @@ class PillContextTests: XCTestCase {
|
||||
let context = PillContext(roomContext: mock.context, data: PillTextAttachmentData(type: .user(userID: id), font: .preferredFont(forTextStyle: .body)))
|
||||
|
||||
XCTAssertFalse(context.viewState.isOwnMention)
|
||||
XCTAssertNil(context.viewState.avatarURL)
|
||||
XCTAssertNil(context.viewState.name)
|
||||
XCTAssertEqual(context.viewState.contentID, id)
|
||||
XCTAssertEqual(context.viewState.displayText, id)
|
||||
|
||||
let name = "Mr. Test"
|
||||
@@ -48,10 +45,7 @@ class PillContextTests: XCTestCase {
|
||||
await Task.yield()
|
||||
|
||||
XCTAssertFalse(context.viewState.isOwnMention)
|
||||
XCTAssertEqual(context.viewState.avatarURL, avatarURL)
|
||||
XCTAssertEqual(context.viewState.name, name)
|
||||
XCTAssertEqual(context.viewState.contentID, id)
|
||||
XCTAssertEqual(context.viewState.displayText, name)
|
||||
XCTAssertEqual(context.viewState.displayText, "@\(name)")
|
||||
}
|
||||
|
||||
func testOwnUser() async throws {
|
||||
@@ -90,9 +84,6 @@ class PillContextTests: XCTestCase {
|
||||
let context = PillContext(roomContext: mock.context, data: PillTextAttachmentData(type: .allUsers, font: .preferredFont(forTextStyle: .body)))
|
||||
|
||||
XCTAssertTrue(context.viewState.isOwnMention)
|
||||
XCTAssertEqual(context.viewState.avatarURL, avatarURL)
|
||||
XCTAssertEqual(context.viewState.name, displayName)
|
||||
XCTAssertEqual(context.viewState.contentID, id)
|
||||
XCTAssertEqual(context.viewState.displayText, "@room")
|
||||
XCTAssertEqual(context.viewState.displayText, PillConstants.atRoom)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user