From aed445954d2b5528eb1a52253c90c57203819257 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 7 Jun 2020 19:57:54 -0500 Subject: [PATCH] Jest: Restore avatar tests --- app/soapbox/components/__tests__/avatar-test.js | 2 +- app/soapbox/components/__tests__/avatar_overlay-test.js | 2 +- app/soapbox/components/avatar.js | 5 +++-- app/soapbox/components/avatar_overlay.js | 5 +++-- jest.config.js | 5 ----- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/soapbox/components/__tests__/avatar-test.js b/app/soapbox/components/__tests__/avatar-test.js index dd3f7b7d2..5a72fc19a 100644 --- a/app/soapbox/components/__tests__/avatar-test.js +++ b/app/soapbox/components/__tests__/avatar-test.js @@ -1,7 +1,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import { fromJS } from 'immutable'; -import Avatar from '../avatar'; +import { Avatar } from '../avatar'; describe('', () => { const account = fromJS({ diff --git a/app/soapbox/components/__tests__/avatar_overlay-test.js b/app/soapbox/components/__tests__/avatar_overlay-test.js index 44addea83..ea75dab57 100644 --- a/app/soapbox/components/__tests__/avatar_overlay-test.js +++ b/app/soapbox/components/__tests__/avatar_overlay-test.js @@ -1,7 +1,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; import { fromJS } from 'immutable'; -import AvatarOverlay from '../avatar_overlay'; +import { AvatarOverlay } from '../avatar_overlay'; describe(' { const account = fromJS({ diff --git a/app/soapbox/components/avatar.js b/app/soapbox/components/avatar.js index f3e1cb678..a4358332b 100644 --- a/app/soapbox/components/avatar.js +++ b/app/soapbox/components/avatar.js @@ -8,8 +8,7 @@ const mapStateToProps = state => ({ animate: getSettings(state).get('autoPlayGif'), }); -export default @connect(mapStateToProps) -class Avatar extends React.PureComponent { +export class Avatar extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map, @@ -74,3 +73,5 @@ class Avatar extends React.PureComponent { } } + +export default connect(mapStateToProps)(Avatar); diff --git a/app/soapbox/components/avatar_overlay.js b/app/soapbox/components/avatar_overlay.js index 1e095b899..a72c4e614 100644 --- a/app/soapbox/components/avatar_overlay.js +++ b/app/soapbox/components/avatar_overlay.js @@ -8,8 +8,7 @@ const mapStateToProps = state => ({ animate: getSettings(state).get('autoPlayGif'), }); -export default @connect(mapStateToProps) -class AvatarOverlay extends React.PureComponent { +export class AvatarOverlay extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, @@ -37,3 +36,5 @@ class AvatarOverlay extends React.PureComponent { } } + +export default connect(mapStateToProps)(AvatarOverlay); diff --git a/jest.config.js b/jest.config.js index ee9db2eae..77fb55c23 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,11 +10,6 @@ module.exports = { '/static/', '/tmp/', '/webpack/', - - // Temporarily disable these tests - // https://gitlab.com/soapbox-pub/soapbox-fe/-/issues/34 - '/app/soapbox/components/__tests__/avatar-test.js', - '/app/soapbox/components/__tests__/avatar_overlay-test.js', ], 'setupFiles': [ 'raf/polyfill',