mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-08 17:17:56 +08:00
29 lines
794 B
React
29 lines
794 B
React
|
import React from 'react';
|
||
|
import {mount} from 'enzyme'
|
||
|
import SendLaterPopover from '../lib/send-later-popover';
|
||
|
|
||
|
|
||
|
const makePopover = (props = {}) => {
|
||
|
return mount(
|
||
|
<SendLaterPopover
|
||
|
sendLaterDate={null}
|
||
|
onSendLater={() => {}}
|
||
|
onAssignSendLaterDate={() => {}}
|
||
|
onCancelSendLater={() => {}}
|
||
|
{...props}
|
||
|
/>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
describe('SendLaterPopover', function sendLaterPopover() {
|
||
|
describe('render', () => {
|
||
|
it('renders cancel button if scheduled', () => {
|
||
|
const onCancelSendLater = jasmine.createSpy('onCancelSendLater')
|
||
|
const popover = makePopover({onCancelSendLater, sendLaterDate: 'date'})
|
||
|
const button = popover.find('.btn-cancel')
|
||
|
button.simulate('click')
|
||
|
expect(onCancelSendLater).toHaveBeenCalled()
|
||
|
});
|
||
|
});
|
||
|
});
|