Skip to content

Commit 5de8311

Browse files
fix(content-picker): add flow type and fix duplicate code
Co-Authored-By: [email protected] <[email protected]>
1 parent 06c8a9c commit 5de8311

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/elements/content-picker/stories/tests/ContentPicker-visual.stories.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1+
// @flow
12
import { expect, userEvent, waitFor, within } from '@storybook/test';
23
import { http, HttpResponse } from 'msw';
34

45
import ContentPicker from '../../ContentPicker';
56
import { mockRootFolder, mockEmptyRootFolder } from '../../../content-explorer/stories/__mocks__/mockRootFolder';
67
import { DEFAULT_HOSTNAME_API } from '../../../../constants';
78

9+
export default {
10+
title: 'Elements/ContentPicker/tests/visual',
11+
component: ContentPicker,
12+
args: {
13+
features: global.FEATURE_FLAGS,
14+
rootFolderId: '69083462919',
15+
token: global.TOKEN,
16+
},
17+
parameters: {
18+
msw: {
19+
handlers: [
20+
http.get(`${DEFAULT_HOSTNAME_API}/2.0/folders/69083462919`, () => {
21+
return HttpResponse.json(mockRootFolder);
22+
}),
23+
],
24+
},
25+
},
26+
};
27+
828
export const basic = {
929
play: async ({ canvasElement }) => {
1030
const canvas = within(canvasElement);
@@ -524,6 +544,7 @@ export const shareAccess = {
524544
name: text => text.includes('0') && text.includes('Selected'),
525545
});
526546
expect(initialSelectedButton).toBeInTheDocument();
547+
527548
const shareInitialChooseButton = canvas.getByLabelText('Choose');
528549
expect(shareInitialChooseButton).toBeDisabled();
529550

@@ -888,22 +909,3 @@ export const searchFunctionality = {
888909
});
889910
},
890911
};
891-
892-
export default {
893-
title: 'Elements/ContentPicker/tests/visual',
894-
component: ContentPicker,
895-
args: {
896-
features: global.FEATURE_FLAGS,
897-
rootFolderId: '69083462919',
898-
token: global.TOKEN,
899-
},
900-
parameters: {
901-
msw: {
902-
handlers: [
903-
http.get(`${DEFAULT_HOSTNAME_API}/2.0/folders/69083462919`, () => {
904-
return HttpResponse.json(mockRootFolder);
905-
}),
906-
],
907-
},
908-
},
909-
};

0 commit comments

Comments
 (0)