Features: focalPoint check

stable/1.0.x
Alex Gleason 2020-06-07 14:52:13 -05:00
rodzic 8f532b1b92
commit dfb133b22c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -108,4 +108,20 @@ describe('getFeatures', () => {
expect(features.attachmentLimit).toEqual(Infinity); 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);
});
});
}); });

Wyświetl plik

@ -8,6 +8,7 @@ export const getFeatures = instance => {
trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'), trends: v.software === 'Mastodon' && semver.gte(v.compatVersion, '3.0.0'),
emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'), emojiReacts: v.software === 'Pleroma' && semver.gte(v.version, '2.0.0'),
attachmentLimit: v.software === 'Pleroma' ? Infinity : 4, attachmentLimit: v.software === 'Pleroma' ? Infinity : 4,
focalPoint: v.software === 'Mastodon' && semver.gte(v.compatVersion, '2.3.0'),
}; };
}; };