diff --git a/packages/components/src/disabled/stories/index.js b/packages/components/src/disabled/stories/index.js
new file mode 100644
index 0000000000000..527c76899c652
--- /dev/null
+++ b/packages/components/src/disabled/stories/index.js
@@ -0,0 +1,31 @@
+/**
+ * Internal dependencies
+ */
+import Disabled from '../';
+import SelectControl from '../../select-control/';
+import TextControl from '../../text-control/';
+import TextareaControl from '../../textarea-control/';
+
+export default {
+ title: 'Components/Disabled',
+ component: Disabled,
+};
+
+export const _default = () => {
+ return (
+
@@ -4348,13 +4437,13 @@ exports[`Storyshots Components/Placeholder Default 1`] = ` >
Help text to explain the select control.
@@ -7939,21 +8028,21 @@ exports[`Storyshots Components/TextControl Default 1`] = ` >Help text to explain the input.
@@ -7979,21 +8068,21 @@ exports[`Storyshots Components/TextareaControl Default 1`] = ` >Help text to explain the textarea.
diff --git a/storybook/test/index.js b/storybook/test/index.js index 8752847743e0b..57f12195d4857 100644 --- a/storybook/test/index.js +++ b/storybook/test/index.js @@ -6,6 +6,23 @@ import initStoryshots, { } from '@storybook/addon-storyshots'; import path from 'path'; +// The current version of JSDOM doesn't support MutationObserver +// This stub is needed to test the Disabled component +// Pending PR #20766 to update jest and JSDOM may make this unnecessary +let MutationObserver; +beforeAll( () => { + MutationObserver = window.MutationObserver; + window.MutationObserver = function() {}; + window.MutationObserver.prototype = { + observe() {}, + disconnect() {}, + }; +} ); + +afterAll( () => { + window.MutationObserver = MutationObserver; +} ); + initStoryshots( { configPath: path.resolve( __dirname, '../' ), test: snapshotWithOptions( ( story ) => ( { @@ -25,7 +42,6 @@ initStoryshots( { const parentElement = document.createElement( 'div' ); parentElement.appendChild( currentElement ); } - return currentElement; }, } ) ),