aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2016-11-12 22:41:43 +0100
committerRoger Braun <roger@rogerbraun.net>2016-11-12 22:41:43 +0100
commit05733b6bc92db37b8c7bbee792f40125714aa020 (patch)
tree9ca6d461cd20e906115bc5590b1400d315cdd691 /test
parentc9ab70db8ea5163b2687adf93f6e3f414873df5d (diff)
Remove attachment links, as we are already showing them.
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/services/status_parser/status_parses.spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/specs/services/status_parser/status_parses.spec.js b/test/unit/specs/services/status_parser/status_parses.spec.js
new file mode 100644
index 00000000..e6d185f8
--- /dev/null
+++ b/test/unit/specs/services/status_parser/status_parses.spec.js
@@ -0,0 +1,11 @@
+const example = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> <a href="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" title="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" class="attachment" id="attachment-159853" rel="nofollow external">https://social.heldscal.la/attachment/159853</a></div>'
+
+import { removeAttachmentLinks } from '../../../../../src/services/status_parser/status_parser.js'
+
+describe('statusParser.removeAttachmentLinks', () => {
+ const exampleWithoutAttachmentLinks = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> </div>'
+ it('removes attachment links', () => {
+ const parsed = removeAttachmentLinks(example)
+ expect(parsed).to.eql(exampleWithoutAttachmentLinks)
+ })
+})