Features: focalPoint check
This commit is contained in:
parent
8f532b1b92
commit
dfb133b22c
2 changed files with 17 additions and 0 deletions
|
@ -108,4 +108,20 @@ describe('getFeatures', () => {
|
|||
expect(features.attachmentLimit).toEqual(Infinity);
|
||||
});
|
||||
});
|
||||
|
||||
describe('focalPoint', () => {
|
||||
it('is true for Mastodon 2.3.0+', () => {
|
||||
const instance = ImmutableMap({ version: '2.3.0' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.focalPoint).toBe(true);
|
||||
});
|
||||
|
||||
it('is false for Pleroma', () => {
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||
});
|
||||
const features = getFeatures(instance);
|
||||
expect(features.focalPoint).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -8,6 +8,7 @@ export const getFeatures = instance => {
|
|||
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
|
||||
emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'),
|
||||
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
|
||||
focalPoint: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.3.0'),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue