Merge branch '1276-hashtag-links-url-safe' of https://github.com/Human-Connection/Human-Connection into 1276-hashtag-links-url-safe

This commit is contained in:
Wolfgang Huß 2019-09-17 10:01:17 +02:00
commit d28a1f17f1
2 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@ describe('extractHashtags', () => {
})
describe('searches through links', () => {
it('not `class="hashtag"` but `data-hashtag-id="something"` makes a link a hashtag link', () => {
it('without `class="hashtag"` but `data-hashtag-id="something"`, and extracts the Hashtag to make a Hashtag link', () => {
const content = `
<p>
<a
@ -35,7 +35,7 @@ describe('extractHashtags', () => {
expect(extractHashtags(content)).toEqual([])
})
it('ignores hashtag links with not allowed character combinations', () => {
it('ignores hashtag links with unsupported character combinations', () => {
// Allowed are all unicode letters '\pL' and all digits '0-9'. There haveto be at least one letter in it.
const content = `
<p>

View File

@ -413,7 +413,7 @@ import { gql } from '../jest/helpers'
const mention2 =
'Hey <a class="mention" data-mention-id="u3" href="/profile/u3">@jenny-rostock</a>, here is another notification for you!'
const hashtag1 =
'See <a class="hashtag" data-hashtag-id="NaturphilosophieYoga" href="/?hashtag=NaturphilosophieYoga">#NaturphilosophieYoga</a> can really help you!'
'See <a class="hashtag" data-hashtag-id="NaturphilosophieYoga" href="/?hashtag=NaturphilosophieYoga">#NaturphilosophieYoga</a>, it can really help you!'
const hashtagAndMention1 =
'The new physics of <a class="hashtag" data-hashtag-id="QuantenFlussTheorie" href="/?hashtag=QuantenFlussTheorie">#QuantenFlussTheorie</a> can explain <a class="hashtag" data-hashtag-id="QuantumGravity" href="/?hashtag=QuantumGravity">#QuantumGravity</a>! <a class="mention" data-mention-id="u1" href="/profile/u1">@peter-lustig</a> got that already. ;-)'
const createPostMutation = gql`
@ -470,9 +470,9 @@ import { gql } from '../jest/helpers'
authenticatedUser = await dewey.toJson()
const mentionInComment1 =
'I heard <a class="mention" data-mention-id="u3" href="/profile/u3">@jenny-rostock</a>, practice it since 3 years now.'
'I heard <a class="mention" data-mention-id="u3" href="/profile/u3">@jenny-rostock</a> has practiced it for 3 years now.'
const mentionInComment2 =
'Did <a class="mention" data-mention-id="u1" href="/profile/u1">@peter-lustig</a> told you?'
'Did <a class="mention" data-mention-id="u1" href="/profile/u1">@peter-lustig</a> tell you?'
const createCommentMutation = gql`
mutation($id: ID, $postId: ID!, $content: String!) {
CreateComment(id: $id, postId: $postId, content: $content) {
@ -661,21 +661,21 @@ import { gql } from '../jest/helpers'
mutate({
mutation: reportMutation,
variables: {
description: "I don't like this comment",
description: 'This comment is bigoted',
id: 'c1',
},
}),
mutate({
mutation: reportMutation,
variables: {
description: "I don't like this post",
description: 'This post is bigoted',
id: 'p1',
},
}),
mutate({
mutation: reportMutation,
variables: {
description: "I don't like this user",
description: 'This user is harassing me with bigoted remarks',
id: 'u1',
},
}),