-
-
Save dereknahman/1add98e93e2a4edf1418a83f693a0065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render, screen } from '../../utils/test-utils'; | |
import CommissionView from '.'; | |
const mocks = { | |
clearCommission: jest.fn(), | |
dispatchCommission: jest.fn(), | |
overlayRealign: jest.fn(), | |
getDeskName: jest.fn('000000000000000000000000'), | |
}; | |
const approvalsState = { | |
approve: jest.fn(), | |
decline: jest.fn(), | |
errorMessage: '', | |
}; | |
const setIsEditPaymentMode = jest.fn(); | |
afterEach(() => { | |
jest.clearAllMocks(); | |
}); | |
describe('CommissionView', () => { | |
const getCommissionState = (overrides) => ({ | |
commissionState: { | |
commission: { | |
contributor: { | |
firstName: '', | |
lastName: '', | |
_id: '000000000000000000000000', | |
}, | |
deskId: mocks.getDeskName, | |
plannedPublishDate: '2022-05-06T15:40:00.000Z', | |
publishedDate: '2022-05-04T14:06:15.691Z', | |
articleId: '00000000-0000-0000-0000-000000000000', | |
title: 'Testing', | |
...overrides, | |
}, | |
}, | |
commissionOverlayState: { | |
overlay: { | |
realign: () => mocks.overlayRealign, | |
}, | |
}, | |
dispatchCommission: mocks.dispatchCommission, | |
clearCommission: mocks.clearCommission, | |
}); | |
beforeEach(() => { | |
const providerProps = { | |
commissionState: getCommissionState({}), | |
}; | |
render( | |
<CommissionView | |
approvalsState={approvalsState} | |
setIsEditPaymentMode={setIsEditPaymentMode} | |
/>, | |
{ | |
providerProps, | |
} | |
); | |
}); | |
it('plannedPublishDate and pulishedDate should update when Article UUID is updated', () => { | |
expect(screen.getByText('Testing')).toBeInTheDocument(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment