Skip to content

Commit 163d04c

Browse files
author
Conrad Chan
authored
feat(docuworks): Update iconType names (#2861)
1 parent 3109c43 commit 163d04c

3 files changed

Lines changed: 266 additions & 372 deletions

File tree

src/icons/item-icon/ItemIcon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const itemIconTable = {
4343
code: IconFileCode,
4444
default: IconFileDefault,
4545
document: IconFileText,
46+
'docuworks-binder': IconFileXbd,
47+
'docuworks-file': IconFileXdw,
4648
dwg: IconFileDwg,
4749
'excel-spreadsheet': IconFileExcelSpreadsheet,
4850
'folder-collab': IconFolderCollab,
@@ -67,8 +69,6 @@ const itemIconTable = {
6769
vector: IconFileVector,
6870
video: IconFileVideo,
6971
'word-document': IconFileWordDocument,
70-
xbd: IconFileXbd,
71-
xdw: IconFileXdw,
7272
zip: IconFileZip,
7373
};
7474

src/icons/item-icon/__tests__/ItemIcon.test.tsx

Lines changed: 47 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -5,130 +5,56 @@ import ItemIcon from '../ItemIcon';
55
describe('icons/item-icon/ItemIcon', () => {
66
const getWrapper = (props = {}) => shallow(<ItemIcon iconType="" {...props} />);
77

8-
describe('render()', () => {
9-
[
10-
{
11-
iconType: 'audio',
12-
},
13-
{
14-
iconType: 'bookmark',
15-
},
16-
{
17-
iconType: 'boxnote',
18-
},
19-
{
20-
iconType: 'code',
21-
},
22-
{
23-
iconType: 'default',
24-
},
25-
{
26-
iconType: 'document',
27-
},
28-
{
29-
iconType: 'dwg',
30-
},
31-
{
32-
iconType: 'excel-spreadsheet',
33-
},
34-
{
35-
iconType: 'folder-collab',
36-
},
37-
{
38-
iconType: 'folder-external',
39-
},
40-
{
41-
iconType: 'folder-plain',
42-
},
43-
{
44-
iconType: 'google-docs',
45-
},
46-
{
47-
iconType: 'google-sheets',
48-
},
49-
{
50-
iconType: 'google-slides',
51-
},
52-
{
53-
iconType: 'illustrator',
54-
},
55-
{
56-
iconType: 'image',
57-
},
58-
{
59-
iconType: 'indesign',
60-
},
61-
{
62-
iconType: 'keynote',
63-
},
64-
{
65-
iconType: 'numbers',
66-
},
67-
{
68-
iconType: 'pages',
69-
},
70-
{
71-
iconType: 'pdf',
72-
},
73-
{
74-
iconType: 'photoshop',
75-
},
76-
{
77-
iconType: 'powerpoint-presentation',
78-
},
79-
{
80-
iconType: 'presentation',
81-
},
82-
{
83-
iconType: 'spreadsheet',
84-
},
85-
{
86-
iconType: 'text',
87-
},
88-
{
89-
iconType: 'threed',
90-
},
91-
{
92-
iconType: 'folder-plain',
93-
},
94-
{
95-
iconType: 'vector',
96-
},
97-
{
98-
iconType: 'video',
99-
},
100-
{
101-
iconType: 'word-document',
102-
},
103-
{
104-
iconType: 'xbd',
105-
},
106-
{
107-
iconType: 'xdw',
108-
},
109-
{
110-
iconType: 'zip',
111-
},
112-
{
113-
iconType: '',
114-
},
115-
].forEach(({ iconType }) => {
116-
test(`should render ${iconType} component`, () => {
117-
const wrapper = getWrapper({ iconType });
8+
describe.each([
9+
'audio',
10+
'bookmark',
11+
'boxnote',
12+
'code',
13+
'default',
14+
'document',
15+
'docuworks-binder',
16+
'docuworks-file',
17+
'dwg',
18+
'excel-spreadsheet',
19+
'folder-collab',
20+
'folder-external',
21+
'folder-plain',
22+
'google-docs',
23+
'google-sheets',
24+
'google-slides',
25+
'illustrator',
26+
'image',
27+
'indesign',
28+
'keynote',
29+
'numbers',
30+
'pages',
31+
'pdf',
32+
'photoshop',
33+
'powerpoint-presentation',
34+
'presentation',
35+
'spreadsheet',
36+
'text',
37+
'threed',
38+
'vector',
39+
'video',
40+
'word-document',
41+
'zip',
42+
])('render()', iconType => {
43+
test(`should render ${iconType} component`, () => {
44+
const wrapper = getWrapper({ iconType });
11845

119-
expect(wrapper).toMatchSnapshot();
120-
});
121-
122-
test('should render component with additional props', () => {
123-
const wrapper = getWrapper({
124-
className: 'test',
125-
dimension: 10,
126-
iconType,
127-
title: 'title',
128-
});
46+
expect(wrapper).toMatchSnapshot();
47+
});
12948

130-
expect(wrapper).toMatchSnapshot();
49+
test(`should render ${iconType} component with additional props`, () => {
50+
const wrapper = getWrapper({
51+
className: 'test',
52+
dimension: 10,
53+
iconType,
54+
title: 'title',
13155
});
56+
57+
expect(wrapper).toMatchSnapshot();
13258
});
13359
});
13460
});

0 commit comments

Comments
 (0)