|
|
@@ -1,7 +1,7 @@
|
|
|
import React from 'react';
|
|
|
|
|
|
import {Message} from 'semantic-ui-react';
|
|
|
-import {Alert} from 'packs/react-app/components/misc/flash_alerts';
|
|
|
+import FlashAlerts, {Alert} from 'packs/react-app/components/misc/flash_alerts';
|
|
|
|
|
|
describe('<Alert />', () => {
|
|
|
describe('constructor()', () => {
|
|
|
@@ -38,3 +38,20 @@ describe('<Alert />', () => {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
+describe('<FlashAlerts />', () => {
|
|
|
+ describe('render()', () => {
|
|
|
+ it('renders child alerts', () => {
|
|
|
+ const wrapper = mount(
|
|
|
+ <FlashAlerts
|
|
|
+ alerts={[
|
|
|
+ {klass: 'foo-alert-1', message: 'foo message 1'},
|
|
|
+ {klass: 'foo-alert-2', message: 'foo message 2'},
|
|
|
+ ]}
|
|
|
+ />,
|
|
|
+ );
|
|
|
+
|
|
|
+ expect(wrapper.find(Alert).length).toEqual(2);
|
|
|
+ });
|
|
|
+ });
|
|
|
+});
|