aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2016-11-13 00:08:03 +0100
committerRoger Braun <roger@rogerbraun.net>2016-11-13 00:08:03 +0100
commitee009f63dd2f4856f8daf29d66301f67ab8f2021 (patch)
tree99fa296d6091090692277d77562482c576bee7de /test/unit
parent43eb9c022d49047e898657bf41ee5a9d9b27fe27 (diff)
Don't break status parsing when link class is missing.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/specs/services/status_parser/status_parses.spec.js6
1 files changed, 6 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
index e6d185f8..65808d84 100644
--- a/test/unit/specs/services/status_parser/status_parses.spec.js
+++ b/test/unit/specs/services/status_parser/status_parses.spec.js
@@ -4,8 +4,14 @@ import { removeAttachmentLinks } from '../../../../../src/services/status_parser
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)
})
+
+ it('works when the class is empty', () => {
+ const parsed = removeAttachmentLinks('<a></a>')
+ expect(parsed).to.eql('<a></a>')
+ })
})