sforkowany z mirror/soapbox
Reformat features-test.js
rodzic
d772608df4
commit
cc6aae5937
|
@ -2,11 +2,11 @@ import {
|
|||
parseVersion,
|
||||
getFeatures,
|
||||
} from '../features';
|
||||
import { fromJS } from 'immutable';
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
|
||||
describe('parseVersion', () => {
|
||||
it('with Pleroma version string', () => {
|
||||
let version = '2.7.2 (compatible; Pleroma 2.0.5-6-ga36eb5ea-plerasstodon+dev)';
|
||||
const version = '2.7.2 (compatible; Pleroma 2.0.5-6-ga36eb5ea-plerasstodon+dev)';
|
||||
expect(parseVersion(version)).toEqual({
|
||||
software: 'Pleroma',
|
||||
version: '2.0.5-6-ga36eb5ea-plerasstodon+dev',
|
||||
|
@ -15,7 +15,7 @@ describe('parseVersion', () => {
|
|||
});
|
||||
|
||||
it('with Mastodon version string', () => {
|
||||
let version = '3.0.0';
|
||||
const version = '3.0.0';
|
||||
expect(parseVersion(version)).toEqual({
|
||||
software: 'Mastodon',
|
||||
version: '3.0.0',
|
||||
|
@ -27,68 +27,68 @@ describe('parseVersion', () => {
|
|||
describe('getFeatures', () => {
|
||||
describe('emojiReacts', () => {
|
||||
it('is true for Pleroma 2.0+', () => {
|
||||
let instance = fromJS({
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 2.0.5-6-ga36eb5ea-plerasstodon+dev)',
|
||||
});
|
||||
let features = getFeatures(instance);
|
||||
const features = getFeatures(instance);
|
||||
expect(features.emojiReacts).toBe(true);
|
||||
});
|
||||
|
||||
it('is false for Pleroma < 2.0', () => {
|
||||
let instance = fromJS({
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||
});
|
||||
let features = getFeatures(instance);
|
||||
const features = getFeatures(instance);
|
||||
expect(features.emojiReacts).toBe(false);
|
||||
});
|
||||
|
||||
it('is false for Mastodon', () => {
|
||||
let instance = fromJS({ version: '3.1.4' });
|
||||
let features = getFeatures(instance);
|
||||
const instance = ImmutableMap({ version: '3.1.4' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.emojiReacts).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('suggestions', () => {
|
||||
it('is true for Mastodon 2.4.3+', () => {
|
||||
let instance = fromJS({ version: '2.4.3' });
|
||||
let features = getFeatures(instance);
|
||||
const instance = ImmutableMap({ version: '2.4.3' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.suggestions).toBe(true);
|
||||
});
|
||||
|
||||
it('is false for Mastodon < 2.4.3', () => {
|
||||
let instance = fromJS({ version: '2.4.2' });
|
||||
let features = getFeatures(instance);
|
||||
const instance = ImmutableMap({ version: '2.4.2' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.suggestions).toBe(false);
|
||||
});
|
||||
|
||||
it('is false for Pleroma', () => {
|
||||
let instance = fromJS({
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||
});
|
||||
let features = getFeatures(instance);
|
||||
const features = getFeatures(instance);
|
||||
expect(features.suggestions).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('trends', () => {
|
||||
it('is true for Mastodon 3.0.0+', () => {
|
||||
let instance = fromJS({ version: '3.0.0' });
|
||||
let features = getFeatures(instance);
|
||||
const instance = ImmutableMap({ version: '3.0.0' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.trends).toBe(true);
|
||||
});
|
||||
|
||||
it('is false for Mastodon < 3.0.0', () => {
|
||||
let instance = fromJS({ version: '2.4.3' });
|
||||
let features = getFeatures(instance);
|
||||
const instance = ImmutableMap({ version: '2.4.3' });
|
||||
const features = getFeatures(instance);
|
||||
expect(features.trends).toBe(false);
|
||||
});
|
||||
|
||||
it('is false for Pleroma', () => {
|
||||
let instance = fromJS({
|
||||
const instance = ImmutableMap({
|
||||
version: '2.7.2 (compatible; Pleroma 1.1.50-42-g3d9ac6ae-develop)',
|
||||
});
|
||||
let features = getFeatures(instance);
|
||||
const features = getFeatures(instance);
|
||||
expect(features.trends).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue