Mailspring/app/internal_packages/notifications/specs/dev-mode-notif-spec.jsx

26 lines
838 B
React
Raw Normal View History

2017-09-27 02:33:08 +08:00
import { mount } from 'enzyme';
import { React } from 'mailspring-exports';
import DevModeNotification from '../lib/items/dev-mode-notif';
2017-09-27 02:33:08 +08:00
describe('DevModeNotif', function DevModeNotifTests() {
describe('When the window is in dev mode', () => {
beforeEach(() => {
2017-09-27 02:36:58 +08:00
spyOn(AppEnv, 'inDevMode').andReturn(true);
this.notif = mount(<DevModeNotification />);
2017-09-27 02:33:08 +08:00
});
it('displays a notification', () => {
2017-02-10 07:17:11 +08:00
expect(this.notif.find('.notification').exists()).toEqual(true);
2017-09-27 02:33:08 +08:00
});
});
2017-09-27 02:33:08 +08:00
describe('When the window is not in dev mode', () => {
beforeEach(() => {
2017-09-27 02:36:58 +08:00
spyOn(AppEnv, 'inDevMode').andReturn(false);
this.notif = mount(<DevModeNotification />);
2017-09-27 02:33:08 +08:00
});
it("doesn't display a notification", () => {
2017-02-10 07:17:11 +08:00
expect(this.notif.find('.notification').exists()).toEqual(false);
2017-09-27 02:33:08 +08:00
});
});
});