Perform better normalization of allowedEmoji
This commit is contained in:
parent
54d76d6b56
commit
1466a08193
3 changed files with 20 additions and 1 deletions
19
app/soapbox/actions/__tests__/soapbox.test.ts
Normal file
19
app/soapbox/actions/__tests__/soapbox.test.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { rootState } from '../../jest/test-helpers';
|
||||
import { getSoapboxConfig } from '../soapbox';
|
||||
|
||||
const ASCII_HEART = '❤'; // '\u2764\uFE0F'
|
||||
const RED_HEART_RGI = '❤️'; // '\u2764'
|
||||
|
||||
describe('getSoapboxConfig()', () => {
|
||||
it('returns RGI heart on Pleroma > 2.3', () => {
|
||||
const state = rootState.setIn(['instance', 'version'], '2.7.2 (compatible; Pleroma 2.3.0)');
|
||||
expect(getSoapboxConfig(state).allowedEmoji.includes(RED_HEART_RGI)).toBe(true);
|
||||
expect(getSoapboxConfig(state).allowedEmoji.includes(ASCII_HEART)).toBe(false);
|
||||
});
|
||||
|
||||
it('returns an ASCII heart on Pleroma < 2.3', () => {
|
||||
const state = rootState.setIn(['instance', 'version'], '2.7.2 (compatible; Pleroma 2.0.0)');
|
||||
expect(getSoapboxConfig(state).allowedEmoji.includes(ASCII_HEART)).toBe(true);
|
||||
expect(getSoapboxConfig(state).allowedEmoji.includes(RED_HEART_RGI)).toBe(false);
|
||||
});
|
||||
});
|
Binary file not shown.
|
@ -83,7 +83,7 @@ const getInstanceFeatures = (instance: Instance) => {
|
|||
chats: v.software === PLEROMA && gte(v.version, '2.1.0'),
|
||||
chatsV2: v.software === PLEROMA && gte(v.version, '2.3.0'),
|
||||
scopes: v.software === PLEROMA ? 'read write follow push admin' : 'read write follow push',
|
||||
federating: federation.get('enabled', true), // Assume true unless explicitly false
|
||||
federating: federation.get('enabled', true) === true, // Assume true unless explicitly false
|
||||
richText: v.software === PLEROMA,
|
||||
securityAPI: any([
|
||||
v.software === PLEROMA,
|
||||
|
|
Loading…
Reference in a new issue