diff --git a/test/unit/components/email-confirmation-modal.test.jsx b/test/unit/components/email-confirmation-modal.test.jsx new file mode 100644 index 000000000..bb01f3b69 --- /dev/null +++ b/test/unit/components/email-confirmation-modal.test.jsx @@ -0,0 +1,41 @@ +const React = require('react'); +const {mountWithIntl} = require('../../helpers/intl-helpers.jsx'); +const EmailConfirmationModal = require('../../../src/components/modal/email-confirmation/modal.jsx'); +import configureStore from 'redux-mock-store'; + + +describe('Modal', () => { + const mockStore = configureStore(); + let defaultStore; + const testEmail = 'test123@email.com'; + + beforeEach(() => { + defaultStore = mockStore({ + session: { + session: { + user: { + email: testEmail + }, + permissions: {} + } + } + }); + }); + + test('Display email prop correctly', () => { + const component = mountWithIntl( + , {context: {store: defaultStore}} + ); + expect(component.find('div.modal-right-content').text()).toContain(testEmail); + }); + + test('Close button shows correctly', () => { + const component = mountWithIntl( + , {context: {store: defaultStore}} + ); + expect(component.find('div.modal-content-close').exists()).toBe(false); + expect(component.find('img.modal-content-close-img').exists()).toBe(false); + }); +});