[SIP-15] Adding initial framework (#8398)

* [sip-15] Adding initial framework

* [toast] Addressing etr2460's comments

* [fix] Addressing etr2460's comments
This commit is contained in:
John Bodley
2019-10-28 14:23:12 -07:00
committed by GitHub
parent f7f0be502d
commit 8b74745f9e
15 changed files with 182 additions and 29 deletions

View File

@@ -18,7 +18,7 @@
*/
import { Alert } from 'react-bootstrap';
import React from 'react';
import { shallow } from 'enzyme';
import { mount } from 'enzyme';
import mockMessageToasts from '../mockMessageToasts';
import Toast from '../../../../src/messageToasts/components/Toast';
@@ -30,7 +30,7 @@ describe('Toast', () => {
};
function setup(overrideProps) {
const wrapper = shallow(<Toast {...props} {...overrideProps} />);
const wrapper = mount(<Toast {...props} {...overrideProps} />);
return wrapper;
}
@@ -41,9 +41,14 @@ describe('Toast', () => {
it('should render toastText within the alert', () => {
const wrapper = setup();
const alert = wrapper.find(Alert).dive();
const alert = wrapper.find(Alert);
expect(alert.childAt(1).text()).toBe(props.toast.text);
expect(
alert
.childAt(0)
.childAt(1)
.text(),
).toBe(props.toast.text);
});
it('should call onCloseToast upon alert dismissal', done => {