diff --git a/app/react/src/client/preview/client_api.test.js b/app/react/src/client/preview/client_api.test.js index acb45b425c1f..529579003cdb 100644 --- a/app/react/src/client/preview/client_api.test.js +++ b/app/react/src/client/preview/client_api.test.js @@ -55,7 +55,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa(); + api.storiesOf('none', module).aa(); expect(data).toBe('foo'); }); @@ -75,7 +75,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa().bb(); + api.storiesOf('none', module).aa().bb(); expect(data).toEqual(['foo', 'bar']); }); @@ -89,7 +89,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa(); + api.storiesOf('none', module).aa(); expect(data).toBe('function'); }); @@ -109,7 +109,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').bb(); + api.storiesOf('none', module).bb(); expect(data).toBe('foo'); }); @@ -124,7 +124,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf(kind).aa(); + api.storiesOf(kind, module).aa(); expect(data).toBe(kind); }); }); @@ -133,7 +133,7 @@ describe('preview.client_api', () => { it('should add local decorators', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator(fn => `aa-${fn()}`); localApi.add('storyName', () => 'Hello'); @@ -144,7 +144,7 @@ describe('preview.client_api', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); api.addDecorator(fn => `bb-${fn()}`); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.add('storyName', () => 'Hello'); expect(storyStore.stories[0].fn()).toBe('bb-Hello'); @@ -153,7 +153,7 @@ describe('preview.client_api', () => { it('should utilize both decorators at once', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); api.addDecorator(fn => `aa-${fn()}`); localApi.addDecorator(fn => `bb-${fn()}`); @@ -165,7 +165,7 @@ describe('preview.client_api', () => { it('should pass the context', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator(fn => `aa-${fn()}`); localApi.add('storyName', ({ kind, story }) => `${kind}-${story}`); @@ -180,7 +180,7 @@ describe('preview.client_api', () => { it('should have access to the context', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator((fn, { kind, story }) => `${kind}-${story}-${fn()}`); localApi.add('storyName', () => 'Hello'); @@ -219,10 +219,10 @@ describe('preview.client_api', () => { 'story-2.1': () => 'story-2.1', 'story-2.2': () => 'story-2.2', }; - const kind1 = api.storiesOf('kind-1'); + const kind1 = api.storiesOf('kind-1', module); kind1.add('story-1.1', functions['story-1.1']); kind1.add('story-1.2', functions['story-1.2']); - const kind2 = api.storiesOf('kind-2'); + const kind2 = api.storiesOf('kind-2', module); kind2.add('story-2.1', functions['story-2.1']); kind2.add('story-2.2', functions['story-2.2']); const book = api.getStorybook(); diff --git a/app/vue/src/client/preview/client_api.test.js b/app/vue/src/client/preview/client_api.test.js index c59eaf5969c5..484eea98e831 100644 --- a/app/vue/src/client/preview/client_api.test.js +++ b/app/vue/src/client/preview/client_api.test.js @@ -55,7 +55,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa(); + api.storiesOf('none', module).aa(); expect(data).toBe('foo'); }); @@ -75,7 +75,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa().bb(); + api.storiesOf('none', module).aa().bb(); expect(data).toEqual(['foo', 'bar']); }); @@ -89,7 +89,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').aa(); + api.storiesOf('none', module).aa(); expect(data).toBe('function'); }); @@ -109,7 +109,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf('none').bb(); + api.storiesOf('none', module).bb(); expect(data).toBe('foo'); }); @@ -124,7 +124,7 @@ describe('preview.client_api', () => { }, }); - api.storiesOf(kind).aa(); + api.storiesOf(kind, module).aa(); expect(data).toBe(kind); }); }); @@ -133,7 +133,7 @@ describe('preview.client_api', () => { it('should add local decorators', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator(fn => ({ template: `
aa${fn().template}
` })); localApi.add('storyName', () => ({ template: '

hello

' })); @@ -144,7 +144,7 @@ describe('preview.client_api', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); api.addDecorator(fn => ({ template: `
bb${fn().template}
` })); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.add('storyName', () => ({ template: '

hello

' })); expect(storyStore.stories[0].fn().template).toBe('
bb

hello

'); @@ -153,7 +153,7 @@ describe('preview.client_api', () => { it('should utilize both decorators at once', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); api.addDecorator(fn => ({ template: `
aa${fn().template}
` })); localApi.addDecorator(fn => ({ template: `
bb${fn().template}
` })); @@ -165,7 +165,7 @@ describe('preview.client_api', () => { it('should pass the context', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator(fn => ({ template: `
aa${fn().template}
` })); localApi.add('storyName', ({ kind, story }) => ({ template: `

${kind}-${story}

` })); @@ -180,7 +180,7 @@ describe('preview.client_api', () => { it('should have access to the context', () => { const storyStore = new StoryStore(); const api = new ClientAPI({ storyStore }); - const localApi = api.storiesOf('none'); + const localApi = api.storiesOf('none', module); localApi.addDecorator((fn, { kind, story }) => ({ template: `
${kind}-${story}-${fn().template}
`, })); @@ -221,10 +221,10 @@ describe('preview.client_api', () => { 'story-2.1': () => 'story-2.1', 'story-2.2': () => 'story-2.2', }; - const kind1 = api.storiesOf('kind-1'); + const kind1 = api.storiesOf('kind-1', module); kind1.add('story-1.1', functions['story-1.1']); kind1.add('story-1.2', functions['story-1.2']); - const kind2 = api.storiesOf('kind-2'); + const kind2 = api.storiesOf('kind-2', module); kind2.add('story-2.1', functions['story-2.1']); kind2.add('story-2.2', functions['story-2.2']); const book = api.getStorybook(); diff --git a/lib/ui/src/modules/ui/components/layout/index.test.js b/lib/ui/src/modules/ui/components/layout/index.test.js index 687b08fe5a2b..76717982f48f 100755 --- a/lib/ui/src/modules/ui/components/layout/index.test.js +++ b/lib/ui/src/modules/ui/components/layout/index.test.js @@ -10,6 +10,7 @@ describe('manager.ui.components.layout.index', () => { showLeftPanel showDownPanel goFullScreen={false} + downPanelInRight={false} leftPanel={() => 'LeftPanel'} downPanel={() => 'DownPanel'} preview={() => 'Preview'} @@ -28,6 +29,9 @@ describe('manager.ui.components.layout.index', () => { const wrap = shallow( 'LeftPanel'} downPanel={() => 'DownPanel'} preview={() => 'Preview'} @@ -47,6 +51,7 @@ describe('manager.ui.components.layout.index', () => { 'LeftPanel'} downPanel={() => 'DownPanel'} @@ -68,6 +73,7 @@ describe('manager.ui.components.layout.index', () => { showLeftPanel showDownPanel={false} goFullScreen={false} + downPanelInRight={false} leftPanel={() => 'LeftPanel'} downPanel={() => 'DownPanel'} preview={() => 'Preview'} diff --git a/lib/ui/src/modules/ui/components/menu_item.test.js b/lib/ui/src/modules/ui/components/menu_item.test.js index b05046898b33..37b8b5d3cb44 100644 --- a/lib/ui/src/modules/ui/components/menu_item.test.js +++ b/lib/ui/src/modules/ui/components/menu_item.test.js @@ -7,7 +7,11 @@ const keyCodeEnter = 13; describe('manager.ui.components.menu_item', () => { describe('render', () => { test('should use "a" tag', () => { - const wrap = shallow(Content); + const wrap = shallow( + undefined}> + Content + + ); expect( wrap.matchesElement( @@ -25,7 +29,7 @@ describe('manager.ui.components.menu_item', () => { beforeEach(() => { onClick = jest.fn(); - wrap = shallow(); + wrap = shallow(Content); }); test('should call onClick on a click', () => { diff --git a/lib/ui/src/modules/ui/components/search_box.test.js b/lib/ui/src/modules/ui/components/search_box.test.js index 97915daedb91..ed0247fedf3b 100644 --- a/lib/ui/src/modules/ui/components/search_box.test.js +++ b/lib/ui/src/modules/ui/components/search_box.test.js @@ -6,9 +6,14 @@ import FuzzySearch from '@storybook/react-fuzzy'; import SearchBox from './search_box'; describe('manager.ui.components.search_box', () => { + const defaultProps = { + showSearchBox: false, + onSelectStory: () => undefined, + onClose: () => undefined, + }; describe('render', () => { test('should render FuzzySearch inside ReactModal', () => { - const wrap = shallow(); + const wrap = shallow(); const modal = wrap.find(ReactModal); expect(modal).toBePresent(); @@ -28,7 +33,7 @@ describe('manager.ui.components.search_box', () => { stories: ['b', 'c'], }, ]; - const wrap = shallow(); + const wrap = shallow(); const search = wrap.find(FuzzySearch); const expectedList = [ @@ -57,7 +62,7 @@ describe('manager.ui.components.search_box', () => { describe('events', () => { test('should call the onClose prop when modal requests it', () => { const onClose = jest.fn(); - const wrap = shallow(); + const wrap = shallow(); const modal = wrap.find(ReactModal); modal.simulate('requestClose'); @@ -68,7 +73,9 @@ describe('manager.ui.components.search_box', () => { test('should handle selecting a kind', () => { const onSelectStory = jest.fn(); const onClose = jest.fn(); - const wrap = shallow(); + const wrap = shallow( + + ); const modal = wrap.find(FuzzySearch); modal.simulate('select', { @@ -83,7 +90,9 @@ describe('manager.ui.components.search_box', () => { test('should handle selecting a story', () => { const onSelectStory = jest.fn(); const onClose = jest.fn(); - const wrap = shallow(); + const wrap = shallow( + + ); const modal = wrap.find(FuzzySearch); modal.simulate('select', {