From cc6aae593764193fe3cabd6d29c10324b65aa6fe Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 7 Jun 2020 14:26:28 -0500 Subject: [PATCH] Reformat features-test.js --- app/soapbox/utils/__tests__/features-test.js | 42 ++++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/soapbox/utils/__tests__/features-test.js b/app/soapbox/utils/__tests__/features-test.js index 7f2960831..77f8d882a 100644 --- a/app/soapbox/utils/__tests__/features-test.js +++ b/app/soapbox/utils/__tests__/features-test.js @@ -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); }); });