summaryrefslogtreecommitdiffstats
path: root/tests/acceptance
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-09-05 20:20:40 +0200
committerJoas Schilling <coding@schilljs.com>2018-09-06 10:49:27 +0200
commit5023132226c535ec9df24a14dbad8e383e7f4085 (patch)
treeac80e1734e4ee2388f025f78d6ac18ba3048ad3c /tests/acceptance
parent30719ad039af7a41894c25e88df230e6bcd29ca0 (diff)
Show user avatar in mentions in the list of messages
Mentions in the list of messages now show the user avatar instead of an "@" before the user name. The markup and CSS are based on those used in the Comments app, although with some small differences (like using the "mention-user" CSS class) to keep the same visual appearance as before for "mentions" in system messages (which are not highlighted when they refer to the current user, and do not show the user name in bold in any case). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/features/bootstrap/ChatContext.php2
-rw-r--r--tests/acceptance/features/chat.feature4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/acceptance/features/bootstrap/ChatContext.php b/tests/acceptance/features/bootstrap/ChatContext.php
index f5c90a80a..cd599c4f7 100644
--- a/tests/acceptance/features/bootstrap/ChatContext.php
+++ b/tests/acceptance/features/bootstrap/ChatContext.php
@@ -145,7 +145,7 @@ class ChatContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function formattedMentionInChatMessageOf($chatAncestor, $number, $user) {
- return Locator::forThe()->xpath("span[contains(concat(' ', normalize-space(@class), ' '), ' mention-user ') and normalize-space() = '@$user']")->
+ return Locator::forThe()->xpath("span/span[contains(concat(' ', normalize-space(@class), ' '), ' mention-user ') and normalize-space() = '$user']")->
descendantOf(self::textOfChatMessage($chatAncestor, $number))->
describedAs("Formatted mention of $user in chat message $number in the list of received messages");
}
diff --git a/tests/acceptance/features/chat.feature b/tests/acceptance/features/chat.feature
index 44fc0374f..51ab20059 100644
--- a/tests/acceptance/features/chat.feature
+++ b/tests/acceptance/features/chat.feature
@@ -134,7 +134,7 @@ Feature: chat
And I create a group conversation
And I see that the chat is shown in the main view
When I send a new chat message with the text "Hello @admin"
- Then I see that the message 1 was sent by "user0" with the text "Hello @admin"
+ Then I see that the message 1 was sent by "user0" with the text "Hello admin"
And I see that the message 1 contains a formatted mention of "admin"
Scenario: mention another user and a URL
@@ -148,6 +148,6 @@ Feature: chat
# converted to plain text; it does not appear when the message is rendered
# by browsers, it is just an artefact from the conversion algorithm of the
# underlying libraries used by the tests.
- Then I see that the message 1 was sent by "user0" with the text "Hello @admin , check http://www.nextcloud.com"
+ Then I see that the message 1 was sent by "user0" with the text "Hello admin , check http://www.nextcloud.com"
And I see that the message 1 contains a formatted mention of "admin"
And I see that the message 1 contains a formatted link to "http://www.nextcloud.com"