Test for mentions with spaces in them.

Also remove Converse from fullscreen background
This commit is contained in:
JC Brand 2018-08-16 16:02:09 +02:00
parent 1511eb13d9
commit 41a42fe2f7
2 changed files with 9 additions and 7 deletions

View File

@ -12,11 +12,6 @@
<script src="dist/converse.js"></script>
</head>
<body class="reset">
<div class="content">
<div class="inner-content">
<h1 class="brand-heading"><i class="icon-conversejs"></i> Converse</h1>
</div>
</div>
<script>
/*
@licstart

View File

@ -2145,7 +2145,7 @@
test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom')
.then(() => {
const view = _converse.chatboxviews.get('lounge@localhost');
['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh'].forEach((nick) => {
['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh', 'Link Mauve'].forEach((nick) => {
_converse.connection._dataRecv(test_utils.createRequest(
$pres({
'to': 'tom@localhost/resource',
@ -2154,7 +2154,7 @@
.c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', {
'affiliation': 'none',
'jid': `${nick}@localhost/resource`,
'jid': `${nick.replace(/\s/g, '-')}@localhost/resource`,
'role': 'participant'
})));
});
@ -2190,6 +2190,13 @@
expect(references.length).toBe(1);
expect(JSON.stringify(references))
.toBe('[{"begin":0,"end":6,"value":"gibson","type":"mention","uri":"xmpp:gibson@localhost"}]');
[text, references] = view.model.parseTextForReferences('hi @Link Mauve how are you?')
expect(text).toBe('hi Link Mauve how are you?');
expect(references.length).toBe(1);
expect(JSON.stringify(references))
.toBe('[{"begin":3,"end":13,"value":"Link Mauve","type":"mention","uri":"xmpp:Link-Mauve@localhost"}]');
done();
return;
});