use better emoji removal algorithm (#452)
another follow-up to #450 to fix #449
This commit is contained in:
parent
af1d4b63d3
commit
aea952daf0
|
@ -1,5 +1,5 @@
|
||||||
import { replaceAll } from './strings'
|
import { replaceAll } from './strings'
|
||||||
import emojiRegex from 'emoji-regex'
|
import emojiRegex from 'emoji-regex/es2015/text.js'
|
||||||
|
|
||||||
let theEmojiRegex
|
let theEmojiRegex
|
||||||
|
|
||||||
|
|
|
@ -106,3 +106,23 @@ test('Check status aria labels for de-emojified text', async t => {
|
||||||
.click(displayNameInComposeBox)
|
.click(displayNameInComposeBox)
|
||||||
.expect(getNthStatus(0).getAttribute('aria-label')).eql('Status by 🌈 foo :blobpats: 🌈')
|
.expect(getNthStatus(0).getAttribute('aria-label')).eql('Status by 🌈 foo :blobpats: 🌈')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('Check some odd emoji', async t => {
|
||||||
|
await updateUserDisplayNameAs('foobar', 'foo 🕹📺')
|
||||||
|
await sleep(1000)
|
||||||
|
await loginAsFoobar(t)
|
||||||
|
await t
|
||||||
|
.expect(displayNameInComposeBox.innerText).eql('foo 🕹📺')
|
||||||
|
.click(settingsNavButton)
|
||||||
|
.click(generalSettingsButton)
|
||||||
|
.click(removeEmojiFromDisplayNamesInput)
|
||||||
|
.expect(removeEmojiFromDisplayNamesInput.checked).ok()
|
||||||
|
.click(homeNavButton)
|
||||||
|
.expect(displayNameInComposeBox.innerText).eql('foo')
|
||||||
|
.click(settingsNavButton)
|
||||||
|
.click(generalSettingsButton)
|
||||||
|
.click(removeEmojiFromDisplayNamesInput)
|
||||||
|
.expect(removeEmojiFromDisplayNamesInput.checked).notOk()
|
||||||
|
.click(homeNavButton)
|
||||||
|
.expect(displayNameInComposeBox.innerText).eql('foo 🕹📺')
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue