diff --git a/src/components/toast/__snapshots__/global_toast_list.test.js.snap b/src/components/toast/__snapshots__/global_toast_list.test.js.snap
index 447a1162053..812fd7b0fc9 100644
--- a/src/components/toast/__snapshots__/global_toast_list.test.js.snap
+++ b/src/components/toast/__snapshots__/global_toast_list.test.js.snap
@@ -5,5 +5,9 @@ exports[`EuiGlobalToastList is rendered 1`] = `
aria-label="aria-label"
class="euiGlobalToastList testClass1 testClass2"
data-test-subj="test subject string"
-/>
+>
+
+ hi
+
+
`;
diff --git a/src/components/toast/__snapshots__/toast.test.js.snap b/src/components/toast/__snapshots__/toast.test.js.snap
index aa7bae612bd..18f05d0483d 100644
--- a/src/components/toast/__snapshots__/toast.test.js.snap
+++ b/src/components/toast/__snapshots__/toast.test.js.snap
@@ -1,5 +1,97 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`EuiToast Props color danger is rendered 1`] = `
+
+`;
+
+exports[`EuiToast Props color primary is rendered 1`] = `
+
+`;
+
+exports[`EuiToast Props color success is rendered 1`] = `
+
+`;
+
+exports[`EuiToast Props color warning is rendered 1`] = `
+
+`;
+
+exports[`EuiToast Props iconType is rendered 1`] = `
+
+`;
+
+exports[`EuiToast Props title is rendered 1`] = `
+
+`;
+
exports[`EuiToast is rendered 1`] = `
`;
diff --git a/src/components/toast/global_toast_list.test.js b/src/components/toast/global_toast_list.test.js
index d65854b5b64..0980bb37402 100644
--- a/src/components/toast/global_toast_list.test.js
+++ b/src/components/toast/global_toast_list.test.js
@@ -7,7 +7,9 @@ import { EuiGlobalToastList } from './global_toast_list';
describe('EuiGlobalToastList', () => {
test('is rendered', () => {
const component = render(
-
+
+ hi
+
);
expect(component)
diff --git a/src/components/toast/toast.js b/src/components/toast/toast.js
index 633677bc19d..90615cc5cb7 100644
--- a/src/components/toast/toast.js
+++ b/src/components/toast/toast.js
@@ -48,6 +48,7 @@ export const EuiToast = ({ title, color, iconType, onClose, children, className,
className="euiToast__closeButton"
aria-label="Dismiss toast"
onClick={onClose}
+ data-test-subj="toastCloseButton"
>
{
test('is rendered', () => {
const component = render(
-
+
+ Hi
+
);
expect(component)
.toMatchSnapshot();
});
+
+ describe('Props', () => {
+ describe('title', () => {
+ test('is rendered', () => {
+ const component = ;
+ expect(shallow(component)).toMatchSnapshot();
+ });
+ });
+
+ describe('color', () => {
+ COLORS.forEach(color => {
+ test(`${color} is rendered`, () => {
+ const component = ;
+ expect(shallow(component)).toMatchSnapshot();
+ });
+ });
+ });
+
+ describe('iconType', () => {
+ test('is rendered', () => {
+ const component = ;
+ expect(shallow(component)).toMatchSnapshot();
+ });
+ });
+
+ describe('onClose', () => {
+ test('is called when the close button is clicked', () => {
+ const onCloseHandler = sinon.stub();
+
+ const component = shallow(
+
+ );
+ const closeButton = findTestSubject(component, 'toastCloseButton');
+ closeButton.simulate('click');
+
+ sinon.assert.calledOnce(onCloseHandler);
+ });
+ });
+ });
});