From 4feb5e8087a90182acc1e224da442bef059481da Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 19 Jan 2017 13:44:50 +0200 Subject: [PATCH] A run with correct Prettier version --- src/app.js | 12 ++---- src/components/PageLayout/PageLayout.js | 4 +- .../AuthenticationPage/AuthenticationPage.js | 12 +++--- .../AuthenticationPage.test.js | 8 ++-- .../CheckoutPage/CheckoutPage.test.js | 8 ++-- .../ContactDetailsPage/ContactDetailsPage.js | 2 +- .../ContactDetailsPage.test.js | 8 ++-- .../ConversationPage/ConversationPage.test.js | 8 ++-- .../EditProfilePage/EditProfilePage.test.js | 8 ++-- src/containers/InboxPage/InboxPage.test.js | 2 +- src/containers/LandingPage/LandingPage.js | 2 +- .../LandingPage/LandingPage.test.js | 8 ++-- .../ListingPage/ListingPage.test.js | 8 ++-- .../ManageListingsPage/ManageListingsPage.js | 2 +- .../ManageListingsPage.test.js | 8 ++-- src/containers/NotFoundPage/NotFoundPage.js | 2 +- .../NotFoundPage/NotFoundPage.test.js | 8 ++-- .../NotificationSettingsPage.js | 2 +- .../NotificationSettingsPage.test.js | 8 ++-- src/containers/OrderPage/OrderPage.js | 8 +++- src/containers/OrderPage/OrderPage.test.js | 8 ++-- .../PasswordChangePage/PasswordChangePage.js | 2 +- .../PasswordChangePage.test.js | 8 ++-- .../PasswordForgottenPage.js | 2 +- .../PasswordForgottenPage.test.js | 8 ++-- .../PaymentMethodsPage/PaymentMethodsPage.js | 2 +- .../PaymentMethodsPage.test.js | 8 ++-- .../PayoutPreferencesPage.js | 2 +- .../PayoutPreferencesPage.test.js | 8 ++-- .../ProfilePage/ProfilePage.test.js | 8 ++-- .../SalesConversationPage.js | 4 +- .../SalesConversationPage.test.js | 8 ++-- src/containers/SearchPage/SearchPage.test.js | 10 ++--- src/containers/SecurityPage/SecurityPage.js | 2 +- .../SecurityPage/SecurityPage.test.js | 8 ++-- src/ducks/FlashNotification.js | 2 +- src/ducks/FlashNotification.test.js | 43 +++++-------------- 37 files changed, 138 insertions(+), 123 deletions(-) diff --git a/src/app.js b/src/app.js index 6fe871dc..4c82629b 100644 --- a/src/app.js +++ b/src/app.js @@ -10,13 +10,11 @@ export const ClientApp = props => { const { store } = props; return ( - { - ({router}) => ( + {({ router }) => ( - ) - } + )} ); }; @@ -29,13 +27,11 @@ export const ServerApp = props => { const { url, context, store } = props; return ( - { - ({router}) => ( + {({ router }) => ( - ) - } + )} ); }; diff --git a/src/components/PageLayout/PageLayout.js b/src/components/PageLayout/PageLayout.js index 68cbe61b..046d6627 100644 --- a/src/components/PageLayout/PageLayout.js +++ b/src/components/PageLayout/PageLayout.js @@ -5,10 +5,9 @@ import { Topbar } from '../../containers'; const scrollToTop = () => { // Todo: this might need fine tuning later window.scrollTo(0, 0); -} +}; class PageLayout extends Component { - componentDidMount() { this.historyUnlisten = this.context.history.listen(() => scrollToTop()); } @@ -17,7 +16,6 @@ class PageLayout extends Component { this.historyUnlisten(); } - render() { const { className, title, children } = this.props; return ( diff --git a/src/containers/AuthenticationPage/AuthenticationPage.js b/src/containers/AuthenticationPage/AuthenticationPage.js index 76eac332..3fd82cef 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.js @@ -30,10 +30,12 @@ class AuthenticationPage extends Component { const alternativeMethod = this.props.tab === 'login' ? toSignup : toLogin; const currentMethod = this.props.tab === 'login' ? 'Log in' : 'Sign up'; - const fromLoginMsg = from ?

- You must log in to view the page at - {from.pathname} -

: null; + const fromLoginMsg = from ? ( +

+ You must log in to view the page at + {from.pathname} +

+ ) : null; return ( @@ -51,7 +53,7 @@ AuthenticationPage.defaultProps = { location: {}, tab: 'signup' }; const { shape, string, object, oneOf, oneOfType } = PropTypes; AuthenticationPage.propTypes = { - location: shape({ state: shape({ from: oneOfType([object, string]) }) }), + location: shape({ state: shape({ from: oneOfType([ object, string ]) }) }), tab: oneOf([ 'login', 'signup' ]), }; diff --git a/src/containers/AuthenticationPage/AuthenticationPage.test.js b/src/containers/AuthenticationPage/AuthenticationPage.test.js index c6885d77..c6fc46de 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.test.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.test.js @@ -6,9 +6,11 @@ import AuthenticationPage from './AuthenticationPage'; describe('AuthenticationPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/CheckoutPage/CheckoutPage.test.js b/src/containers/CheckoutPage/CheckoutPage.test.js index 0887a31a..14834f2f 100644 --- a/src/containers/CheckoutPage/CheckoutPage.test.js +++ b/src/containers/CheckoutPage/CheckoutPage.test.js @@ -6,9 +6,11 @@ import CheckoutPage from './CheckoutPage'; describe('CheckoutPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.js b/src/containers/ContactDetailsPage/ContactDetailsPage.js index c96ad26b..7ab15bea 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.test.js b/src/containers/ContactDetailsPage/ContactDetailsPage.test.js index 31207dc4..ae0d096c 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.test.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.test.js @@ -6,9 +6,11 @@ import ContactDetailsPage from './ContactDetailsPage'; describe('ContactDetailsPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ConversationPage/ConversationPage.test.js b/src/containers/ConversationPage/ConversationPage.test.js index eef04a4c..3d9af4af 100644 --- a/src/containers/ConversationPage/ConversationPage.test.js +++ b/src/containers/ConversationPage/ConversationPage.test.js @@ -6,9 +6,11 @@ import ConversationPage from './ConversationPage'; describe('ConversationPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/EditProfilePage/EditProfilePage.test.js b/src/containers/EditProfilePage/EditProfilePage.test.js index 98a22b7e..ef5c30ba 100644 --- a/src/containers/EditProfilePage/EditProfilePage.test.js +++ b/src/containers/EditProfilePage/EditProfilePage.test.js @@ -6,9 +6,11 @@ import EditProfilePage from './EditProfilePage'; describe('EditProfilePage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/InboxPage/InboxPage.test.js b/src/containers/InboxPage/InboxPage.test.js index cd8eb048..81f4669e 100644 --- a/src/containers/InboxPage/InboxPage.test.js +++ b/src/containers/InboxPage/InboxPage.test.js @@ -8,7 +8,7 @@ describe('InboxPage', () => { const component = renderer.create( ( - + ), ); diff --git a/src/containers/LandingPage/LandingPage.js b/src/containers/LandingPage/LandingPage.js index db448beb..3d583503 100644 --- a/src/containers/LandingPage/LandingPage.js +++ b/src/containers/LandingPage/LandingPage.js @@ -6,4 +6,4 @@ export default () => ( Find studios -); +) diff --git a/src/containers/LandingPage/LandingPage.test.js b/src/containers/LandingPage/LandingPage.test.js index 87a4dd78..bce166df 100644 --- a/src/containers/LandingPage/LandingPage.test.js +++ b/src/containers/LandingPage/LandingPage.test.js @@ -6,9 +6,11 @@ import LandingPage from './LandingPage'; describe('LandingPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ListingPage/ListingPage.test.js b/src/containers/ListingPage/ListingPage.test.js index 2eebda01..7b427688 100644 --- a/src/containers/ListingPage/ListingPage.test.js +++ b/src/containers/ListingPage/ListingPage.test.js @@ -6,9 +6,11 @@ import ListingPage from './ListingPage'; describe('ListingPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ManageListingsPage/ManageListingsPage.js b/src/containers/ManageListingsPage/ManageListingsPage.js index f9919b58..6a76103e 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.js @@ -8,4 +8,4 @@ export default () => (
  • Listing 1234
  • -); +) diff --git a/src/containers/ManageListingsPage/ManageListingsPage.test.js b/src/containers/ManageListingsPage/ManageListingsPage.test.js index 98c305f2..574dd53b 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.test.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.test.js @@ -6,9 +6,11 @@ import ManageListingsPage from './ManageListingsPage'; describe('ManageListingsPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/NotFoundPage/NotFoundPage.js b/src/containers/NotFoundPage/NotFoundPage.js index 2aa3dc62..50aa9350 100644 --- a/src/containers/NotFoundPage/NotFoundPage.js +++ b/src/containers/NotFoundPage/NotFoundPage.js @@ -6,4 +6,4 @@ export default () => ( Index page -); +) diff --git a/src/containers/NotFoundPage/NotFoundPage.test.js b/src/containers/NotFoundPage/NotFoundPage.test.js index 027ab5dc..254c66c6 100644 --- a/src/containers/NotFoundPage/NotFoundPage.test.js +++ b/src/containers/NotFoundPage/NotFoundPage.test.js @@ -6,9 +6,11 @@ import NotFoundPage from './NotFoundPage'; describe('NotFoundPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/NotificationSettingsPage/NotificationSettingsPage.js b/src/containers/NotificationSettingsPage/NotificationSettingsPage.js index 160a466f..b1cf74e1 100644 --- a/src/containers/NotificationSettingsPage/NotificationSettingsPage.js +++ b/src/containers/NotificationSettingsPage/NotificationSettingsPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/NotificationSettingsPage/NotificationSettingsPage.test.js b/src/containers/NotificationSettingsPage/NotificationSettingsPage.test.js index 6c9df32b..2266fec6 100644 --- a/src/containers/NotificationSettingsPage/NotificationSettingsPage.test.js +++ b/src/containers/NotificationSettingsPage/NotificationSettingsPage.test.js @@ -6,9 +6,11 @@ import NotificationSettingsPage from './NotificationSettingsPage'; describe('NotificationSettingsPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/OrderPage/OrderPage.js b/src/containers/OrderPage/OrderPage.js index 21b6ac16..fe6c2762 100644 --- a/src/containers/OrderPage/OrderPage.js +++ b/src/containers/OrderPage/OrderPage.js @@ -13,7 +13,9 @@ const OrderPage = props => { Details tab

    Mobile layout needs different views for discussion and details.

    - Discussion view is the default if route doesn't specify mobile tab (e.g. /order/1234) + Discussion view is the default if route doesn't specify mobile tab (e.g. + /order/1234 + )

    ); @@ -21,6 +23,8 @@ const OrderPage = props => { const { number, oneOfType, shape, string } = PropTypes; -OrderPage.propTypes = { params: shape({ id: oneOfType([number, string]).isRequired }).isRequired }; +OrderPage.propTypes = { + params: shape({ id: oneOfType([ number, string ]).isRequired }).isRequired, +}; export default OrderPage; diff --git a/src/containers/OrderPage/OrderPage.test.js b/src/containers/OrderPage/OrderPage.test.js index f45def33..ebb298d4 100644 --- a/src/containers/OrderPage/OrderPage.test.js +++ b/src/containers/OrderPage/OrderPage.test.js @@ -6,9 +6,11 @@ import OrderPage from './OrderPage'; describe('OrderPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PasswordChangePage/PasswordChangePage.js b/src/containers/PasswordChangePage/PasswordChangePage.js index acbe8501..a65c64cf 100644 --- a/src/containers/PasswordChangePage/PasswordChangePage.js +++ b/src/containers/PasswordChangePage/PasswordChangePage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/PasswordChangePage/PasswordChangePage.test.js b/src/containers/PasswordChangePage/PasswordChangePage.test.js index 51ba7a55..2680449a 100644 --- a/src/containers/PasswordChangePage/PasswordChangePage.test.js +++ b/src/containers/PasswordChangePage/PasswordChangePage.test.js @@ -6,9 +6,11 @@ import PasswordChangePage from './PasswordChangePage'; describe('PasswordChangePage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PasswordForgottenPage/PasswordForgottenPage.js b/src/containers/PasswordForgottenPage/PasswordForgottenPage.js index 1a51882a..446a8c64 100644 --- a/src/containers/PasswordForgottenPage/PasswordForgottenPage.js +++ b/src/containers/PasswordForgottenPage/PasswordForgottenPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js b/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js index 4f402450..ac9caba1 100644 --- a/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js +++ b/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js @@ -6,9 +6,11 @@ import PasswordForgottenPage from './PasswordForgottenPage'; describe('PasswordForgottenPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PaymentMethodsPage/PaymentMethodsPage.js b/src/containers/PaymentMethodsPage/PaymentMethodsPage.js index 78c59097..de4e76f6 100644 --- a/src/containers/PaymentMethodsPage/PaymentMethodsPage.js +++ b/src/containers/PaymentMethodsPage/PaymentMethodsPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/PaymentMethodsPage/PaymentMethodsPage.test.js b/src/containers/PaymentMethodsPage/PaymentMethodsPage.test.js index b7cc0b6a..49a21213 100644 --- a/src/containers/PaymentMethodsPage/PaymentMethodsPage.test.js +++ b/src/containers/PaymentMethodsPage/PaymentMethodsPage.test.js @@ -6,9 +6,11 @@ import PaymentMethodsPage from './PaymentMethodsPage'; describe('PaymentMethodsPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js index f2b361c2..735d8c25 100644 --- a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js +++ b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => ; +export default () => diff --git a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js index cc60a1cb..2a249f99 100644 --- a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js +++ b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js @@ -6,9 +6,11 @@ import PayoutPreferencesPage from './PayoutPreferencesPage'; describe('PayoutPreferencesPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ProfilePage/ProfilePage.test.js b/src/containers/ProfilePage/ProfilePage.test.js index 291fe4b7..2c2e6586 100644 --- a/src/containers/ProfilePage/ProfilePage.test.js +++ b/src/containers/ProfilePage/ProfilePage.test.js @@ -6,9 +6,11 @@ import ProfilePage from './ProfilePage'; describe('ProfilePage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/SalesConversationPage/SalesConversationPage.js b/src/containers/SalesConversationPage/SalesConversationPage.js index f24f6725..6a80e93e 100644 --- a/src/containers/SalesConversationPage/SalesConversationPage.js +++ b/src/containers/SalesConversationPage/SalesConversationPage.js @@ -13,7 +13,9 @@ const SalesConversationPage = props => { Details tab

    Mobile layout needs different views for discussion and details.

    - Discussion view is the default if route doesn't specify mobile tab (e.g. /order/1234) + Discussion view is the default if route doesn't specify mobile tab (e.g. + /order/1234 + )

    ); diff --git a/src/containers/SalesConversationPage/SalesConversationPage.test.js b/src/containers/SalesConversationPage/SalesConversationPage.test.js index c32b43d8..6d45e10f 100644 --- a/src/containers/SalesConversationPage/SalesConversationPage.test.js +++ b/src/containers/SalesConversationPage/SalesConversationPage.test.js @@ -6,9 +6,11 @@ import SalesConversationPage from './SalesConversationPage'; describe('SalesConversationPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/SearchPage/SearchPage.test.js b/src/containers/SearchPage/SearchPage.test.js index ab212ad8..b2ef2b1e 100644 --- a/src/containers/SearchPage/SearchPage.test.js +++ b/src/containers/SearchPage/SearchPage.test.js @@ -41,16 +41,16 @@ describe('SearchPageDucs', () => { const addFilter1 = { type: ADD_FILTER, payload: filter1 }; const addFilter2 = { type: ADD_FILTER, payload: filter2 }; const reduced = reducer([], addFilter1); - const reducedWithInitialContent = reducer({ filters: [filter1] }, addFilter2); - expect(reduced).toEqual({ filters: [filter1] }); - expect(reducedWithInitialContent).toEqual({ filters: [filter1, filter2] }); + const reducedWithInitialContent = reducer({ filters: [ filter1 ] }, addFilter2); + expect(reduced).toEqual({ filters: [ filter1 ] }); + expect(reducedWithInitialContent).toEqual({ filters: [ filter1, filter2 ] }); }); it('should handle duplicates ADD_FILTER', () => { const filter = { location: 'helsinki' }; const addFilter = { type: ADD_FILTER, payload: filter }; - const reducedWithInitialContent = reducer({ filters: [filter] }, addFilter); - expect(reducedWithInitialContent).toEqual({ filters: [filter] }); + const reducedWithInitialContent = reducer({ filters: [ filter ] }, addFilter); + expect(reducedWithInitialContent).toEqual({ filters: [ filter ] }); }); }); }); diff --git a/src/containers/SecurityPage/SecurityPage.js b/src/containers/SecurityPage/SecurityPage.js index c9a834fa..5b039f4c 100644 --- a/src/containers/SecurityPage/SecurityPage.js +++ b/src/containers/SecurityPage/SecurityPage.js @@ -5,4 +5,4 @@ export default () => (

    Change password, delete account

    -); +) diff --git a/src/containers/SecurityPage/SecurityPage.test.js b/src/containers/SecurityPage/SecurityPage.test.js index 1da5ecfc..6f371307 100644 --- a/src/containers/SecurityPage/SecurityPage.test.js +++ b/src/containers/SecurityPage/SecurityPage.test.js @@ -6,9 +6,11 @@ import SecurityPage from './SecurityPage'; describe('SecurityPage', () => { it('matches snapshot', () => { const component = renderer.create( - - - , + ( + + + + ), ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/ducks/FlashNotification.js b/src/ducks/FlashNotification.js index c5aea686..13d56594 100644 --- a/src/ducks/FlashNotification.js +++ b/src/ducks/FlashNotification.js @@ -35,7 +35,7 @@ export default (state = initialState, action) => { default: return state; } -}; +} // Action Creators let nextMessageId = 1; diff --git a/src/ducks/FlashNotification.test.js b/src/ducks/FlashNotification.test.js index 29881adf..21c5e3a7 100644 --- a/src/ducks/FlashNotification.test.js +++ b/src/ducks/FlashNotification.test.js @@ -10,12 +10,7 @@ describe('FlashNotification', () => { const type = 'error'; const expectedAction = { type: ADD_FLASH_NOTIFICATION, - payload: { - id: 'note_1', - type, - content, - isRead: false, - } + payload: { id: 'note_1', type, content, isRead: false }, }; const serializedExpectations = JSON.stringify(expectedAction); const received = JSON.stringify(addFlashNotification(type, content)); @@ -23,10 +18,7 @@ describe('FlashNotification', () => { }); it('should create an action to remove a notification', () => { - const expectedAction = { - type: REMOVE_FLASH_NOTIFICATION, - payload: { id: 1 }, - }; + const expectedAction = { type: REMOVE_FLASH_NOTIFICATION, payload: { id: 1 } }; expect(removeFlashNotification(1)).toEqual(expectedAction); }); @@ -39,36 +31,21 @@ describe('FlashNotification', () => { }); it('should handle ADD_FLASH_NOTIFICATION', () => { - const flashNote1 = { - id: 0, - type: 'error', - content: 'Run the tests', - isRead: false, - }; - const flashNote2 = { - id: 0, - type: 'error', - content: 'Run the tests again', - isRead: false, - }; + const flashNote1 = { id: 0, type: 'error', content: 'Run the tests', isRead: false }; + const flashNote2 = { id: 0, type: 'error', content: 'Run the tests again', isRead: false }; const addFlashNote1 = { type: ADD_FLASH_NOTIFICATION, payload: flashNote1 }; const addFlashNote2 = { type: ADD_FLASH_NOTIFICATION, payload: flashNote2 }; const reduced = reducer([], addFlashNote1); - const reducedWithInitialContent = reducer([flashNote1], addFlashNote2); - expect(reduced).toEqual([flashNote1]); - expect(reducedWithInitialContent).toEqual([flashNote1, flashNote2]); + const reducedWithInitialContent = reducer([ flashNote1 ], addFlashNote2); + expect(reduced).toEqual([ flashNote1 ]); + expect(reducedWithInitialContent).toEqual([ flashNote1, flashNote2 ]); }); it('should handle duplicates ADD_FILTER', () => { - const flashNote = { - id: 0, - type: 'error', - content: 'Run the tests', - isRead: false, - }; + const flashNote = { id: 0, type: 'error', content: 'Run the tests', isRead: false }; const addFlashNote = { type: ADD_FLASH_NOTIFICATION, payload: flashNote }; - const reducedWithInitialContent = reducer([flashNote], addFlashNote); - expect(reducedWithInitialContent).toEqual([flashNote]); + const reducedWithInitialContent = reducer([ flashNote ], addFlashNote); + expect(reducedWithInitialContent).toEqual([ flashNote ]); }); }); });