Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
41154614
Commit
41154614
authored
Jul 31, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tests independent of URL at which they're run
parent
8de78dfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
spec/http-file-upload.js
spec/http-file-upload.js
+8
-7
spec/messages.js
spec/messages.js
+4
-4
No files found.
spec/http-file-upload.js
View file @
41154614
...
...
@@ -365,10 +365,10 @@
}).
then
(
function
()
{
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg__media
'
).
innerHTML
.
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
</a>
'
);
`<!-- src/templates/image.html -->\n`
+
`<a href="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg" target="_blank" rel="noopener">`
+
`<img class="chat-image img-thumbnail" src="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg">`
+
`</a>`
);
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
done
();
});
...
...
@@ -473,9 +473,10 @@
}).
then
(
function
()
{
// Check that the image renders
expect
(
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg__media
'
).
innerHTML
.
trim
()).
toEqual
(
'
<!-- src/templates/image.html -->
\n
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg"></a>
'
)
`<!-- src/templates/image.html -->\n`
+
`<a href="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg" target="_blank" rel="noopener">`
+
`<img class="chat-image img-thumbnail" src="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg">`
+
`</a>`
);
XMLHttpRequest
.
prototype
.
send
=
send_backup
;
done
();
});
...
...
spec/messages.js
View file @
41154614
...
...
@@ -1815,10 +1815,10 @@
expect
(
msg
.
outerHTML
).
toEqual
(
'
<div class="chat-msg__text">Have you seen this funny image?</div>
'
);
const
media
=
view
.
el
.
querySelector
(
'
.chat-msg .chat-msg__media
'
);
expect
(
media
.
innerHTML
.
replace
(
/
(\r\n
|
\n
|
\r)
/gm
,
""
)).
toEqual
(
'
<!-- src/templates/image.html -->
'
+
'
<a href="http://localhost:8000/logo/conversejs-filled.svg" target="_blank" rel="noopener">
'
+
'
<img class="chat-image img-thumbnail" src="http://localhost:8000/logo/conversejs-filled.svg">
'
+
'
</a>
'
);
`<!-- src/templates/image.html -->`
+
`<a href="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg" target="_blank" rel="noopener">`
+
`<img class="chat-image img-thumbnail" src="
${
window
.
location
.
origin
}
/logo/conversejs-filled.svg">`
+
`</a>`
);
done
();
}).
catch
(
_
.
partial
(
console
.
error
,
_
));
}));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment