mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
adds banner mock test
This commit is contained in:
parent
95f493dae8
commit
b36db10da7
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
const React = require('react');
|
||||
const {mountWithIntl} = require('../../helpers/intl-helpers.jsx');
|
||||
const EmailConfirmationBanner = require('../../../src/components/dropdown-banner/email-confirmation/banner.jsx');
|
||||
jest.mock('../../../src/components/modal/email-confirmation/modal.jsx', () => () => 'MockEmailConfirmationModal');
|
||||
|
||||
|
||||
describe('EmailConfirmationBanner', () => {
|
||||
|
@ -9,9 +10,9 @@ describe('EmailConfirmationBanner', () => {
|
|||
<EmailConfirmationBanner />
|
||||
);
|
||||
|
||||
expect(component.text()).not.toContain('MockEmailConfirmationModal');
|
||||
component.find('a.showEmailConfirmationModalLink').simulate('click');
|
||||
|
||||
expect(component.find('div.modal-content').exists()).toBe(true);
|
||||
expect(component.text()).toContain('MockEmailConfirmationModal');
|
||||
});
|
||||
|
||||
test('Clicking X calls onRequestDismiss', () => {
|
||||
|
|
Loading…
Reference in a new issue