|
|
|
@ -338,9 +338,9 @@ describe('API Entities normalizer', () => {
|
|
|
|
|
|
|
|
|
|
describe('MastoAPI emoji adder', () => {
|
|
|
|
|
const emojis = makeMockEmojiMasto()
|
|
|
|
|
const imageHtml = '<img src="https://example.com/image.png" alt="image" title="image" class="emoji" />'
|
|
|
|
|
const imageHtml = '<img src="https://example.com/image.png" alt=":image:" title=":image:" class="emoji" />'
|
|
|
|
|
.replace(/"/g, '\'')
|
|
|
|
|
const thinkHtml = '<img src="https://example.com/think.png" alt="thinking" title="thinking" class="emoji" />'
|
|
|
|
|
const thinkHtml = '<img src="https://example.com/think.png" alt=":thinking:" title=":thinking:" class="emoji" />'
|
|
|
|
|
.replace(/"/g, '\'')
|
|
|
|
|
|
|
|
|
|
it('correctly replaces shortcodes in supplied string', () => {
|
|
|
|
@ -366,8 +366,8 @@ describe('API Entities normalizer', () => {
|
|
|
|
|
shortcode: '[a-z] {|}*'
|
|
|
|
|
}])
|
|
|
|
|
const result = addEmojis('This post has :c++: emoji and :[a-z] {|}*: emoji', emojis)
|
|
|
|
|
expect(result).to.include('title=\'c++\'')
|
|
|
|
|
expect(result).to.include('title=\'[a-z] {|}*\'')
|
|
|
|
|
expect(result).to.include('title=\':c++:\'')
|
|
|
|
|
expect(result).to.include('title=\':[a-z] {|}*:\'')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|