1
+ /* eslint-disable no-unused-expressions */
1
2
import React from 'react'
2
3
import { shallow } from 'enzyme'
3
4
import AttachmentManager , { ImageManager , ImagePreview , FileManager , FilePreview } from './AttachmentManager'
@@ -17,7 +18,7 @@ const postEditorCaseDefaultProps = {
17
18
type : 'post' ,
18
19
showLabel : true ,
19
20
showLoading : true ,
20
- showsAddButton : true ,
21
+ showsAddButton : true
21
22
}
22
23
23
24
const commentFormCaseDefaultProps = {
@@ -42,49 +43,48 @@ const attachments = [
42
43
43
44
describe ( 'AttachmentManager' , ( ) => {
44
45
it ( 'renders with minProps' , ( ) => {
45
- const wrapper =
46
46
expect ( shallow (
47
47
< AttachmentManager { ...minDefaultProps } />
48
48
) . text ( ) ) . toBe ( '' )
49
- } ) ,
49
+ } )
50
50
51
51
describe ( 'as used with PostEditor (showLabel, showLoading, showAddButtons)' , ( ) => {
52
52
test ( 'when empty' , ( ) => {
53
53
expect ( shallow (
54
54
< AttachmentManager { ...postEditorCaseDefaultProps } />
55
- ) ) . toMatchSnapshot ( )
55
+ ) ) . toMatchSnapshot ( )
56
56
} )
57
57
58
58
test ( 'with attachments' , ( ) => {
59
59
expect ( shallow (
60
60
< AttachmentManager attachments = { attachments } { ...postEditorCaseDefaultProps } />
61
- ) ) . toMatchSnapshot ( )
61
+ ) ) . toMatchSnapshot ( )
62
62
} )
63
63
64
64
test ( 'when loading' , ( ) => {
65
65
expect ( shallow (
66
66
< AttachmentManager uploadAttachmentPending { ...postEditorCaseDefaultProps } />
67
- ) ) . toMatchSnapshot ( )
67
+ ) ) . toMatchSnapshot ( )
68
68
} )
69
69
70
70
test ( 'when loading, with attachments' , ( ) => {
71
71
expect ( shallow (
72
72
< AttachmentManager attachments = { attachments } uploadAttachmentPending { ...postEditorCaseDefaultProps } />
73
- ) ) . toMatchSnapshot ( )
73
+ ) ) . toMatchSnapshot ( )
74
74
} )
75
75
} )
76
76
77
77
describe ( 'as used with CommentForm (default case)' , ( ) => {
78
- test ( 'when empty' , ( ) => {
78
+ test ( 'when empty' , ( ) => {
79
79
expect ( shallow (
80
80
< AttachmentManager { ...commentFormCaseDefaultProps } />
81
- ) ) . toMatchSnapshot ( )
81
+ ) ) . toMatchSnapshot ( )
82
82
} )
83
83
84
84
test ( 'with attachments' , ( ) => {
85
85
expect ( shallow (
86
86
< AttachmentManager attachments = { attachments } { ...commentFormCaseDefaultProps } />
87
- ) ) . toMatchSnapshot ( )
87
+ ) ) . toMatchSnapshot ( )
88
88
} )
89
89
90
90
test ( 'when loading' , ( ) => {
@@ -96,7 +96,7 @@ describe('AttachmentManager', () => {
96
96
test ( 'when loading, with attachments' , ( ) => {
97
97
expect ( shallow (
98
98
< AttachmentManager attachments = { attachments } uploadAttachmentPending { ...commentFormCaseDefaultProps } />
99
- ) ) . toMatchSnapshot ( )
99
+ ) ) . toMatchSnapshot ( )
100
100
} )
101
101
} )
102
102
@@ -105,21 +105,21 @@ describe('AttachmentManager', () => {
105
105
test ( 'with attachments (of both types), when loading' , ( ) => {
106
106
expect ( shallow (
107
107
< AttachmentManager attachmentType = 'image' attachments = { attachments } uploadAttachmentPending { ...minDefaultProps } />
108
- ) ) . toMatchSnapshot ( )
108
+ ) ) . toMatchSnapshot ( )
109
109
} )
110
110
} )
111
111
describe ( '"file"' , ( ) => {
112
112
test ( 'with attachments (of both types), when loading' , ( ) => {
113
113
expect ( shallow (
114
114
< AttachmentManager attachmentType = 'file' attachments = { attachments } uploadAttachmentPending { ...minDefaultProps } />
115
- ) ) . toMatchSnapshot ( )
115
+ ) ) . toMatchSnapshot ( )
116
116
} )
117
117
} )
118
118
describe ( 'not provided' , ( ) => {
119
119
test ( 'with attachments (of both types), when loading' , ( ) => {
120
120
expect ( shallow (
121
121
< AttachmentManager attachments = { attachments } uploadAttachmentPending { ...minDefaultProps } />
122
- ) ) . toMatchSnapshot ( )
122
+ ) ) . toMatchSnapshot ( )
123
123
} )
124
124
} )
125
125
} )
0 commit comments