Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
pr suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Oct 20, 2023
1 parent bec8d87 commit 0ac4928
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extension WysiwygComposerViewModelTests {
MentionsState(userIds: ["@alice:matrix.org"], roomIds: [], roomAliases: [], hasAtRoomMention: false))
}

func testMultipleMentionsBySettingThemWithContent() {
func testMultipleMentionsBySettingThemWithHtmlContent() {
viewModel.setHtmlContent(
"""
<p><a href=\"https://matrix.to/#/@alice:matrix.org\">Alice</a>, \
Expand All @@ -103,12 +103,14 @@ extension WysiwygComposerViewModelTests {
@room</p>
"""
)
var mentionState = viewModel.getMentionsState()
let mentionState = viewModel.getMentionsState()
XCTAssertEqual(Set(mentionState.userIds), ["@alice:matrix.org", "@bob:matrix.org"])
XCTAssertEqual(mentionState.roomAliases, ["#room:matrix.org"])
XCTAssertEqual(mentionState.roomIds, ["!room:matrix.org"])
XCTAssertTrue(mentionState.hasAtRoomMention)

}

func testMultipleMentionsBySettingThemWithMarkdownContent() {
viewModel.setMarkdownContent(
"""
[Room](https://matrix.to/#/!room:matrix.org), \
Expand All @@ -118,7 +120,7 @@ extension WysiwygComposerViewModelTests {
@room
"""
)
mentionState = viewModel.getMentionsState()
let mentionState = viewModel.getMentionsState()
XCTAssertEqual(Set(mentionState.userIds), ["@alice:matrix.org", "@bob:matrix.org"])
XCTAssertEqual(mentionState.roomAliases, ["#room:matrix.org"])
XCTAssertEqual(mentionState.roomIds, ["!room:matrix.org"])
Expand Down

0 comments on commit 0ac4928

Please sign in to comment.