@@ -17,7 +17,7 @@ describe('Contentstack apps installation test', () => {
17
17
done ( )
18
18
} )
19
19
20
- it ( 'Installation with app uid' , done => {
20
+ it ( 'Installation with app uid' , done => {
21
21
const uid = appMock . uid
22
22
const installation = makeInstallation ( { app_uid : uid } )
23
23
expect ( installation . urlPath ) . to . be . equal ( `apps/${ uid } /installations` )
@@ -91,11 +91,7 @@ describe('Contentstack apps installation test', () => {
91
91
. findAll ( )
92
92
. then ( ( installations ) => {
93
93
installations . items . forEach ( installation => {
94
- expect ( installation . status ) . to . be . equal ( installationMock . status )
95
- expect ( installation . uid ) . to . be . equal ( installationMock . uid )
96
- expect ( installation . organization_uid ) . to . be . equal ( installationMock . organization_uid )
97
- expect ( installation . target . type ) . to . be . equal ( installationMock . target . type )
98
- expect ( installation . target . uid ) . to . be . equal ( installationMock . target . uid )
94
+ checkInstallation ( installation )
99
95
} )
100
96
done ( )
101
97
} )
@@ -112,11 +108,23 @@ describe('Contentstack apps installation test', () => {
112
108
makeInstallation ( { data : { uid } } )
113
109
. fetch ( )
114
110
. then ( ( installation ) => {
115
- expect ( installation . status ) . to . be . equal ( installationMock . status )
116
- expect ( installation . uid ) . to . be . equal ( installationMock . uid )
117
- expect ( installation . organization_uid ) . to . be . equal ( installationMock . organization_uid )
118
- expect ( installation . target . type ) . to . be . equal ( installationMock . target . type )
119
- expect ( installation . target . uid ) . to . be . equal ( installationMock . target . uid )
111
+ checkInstallation ( installation )
112
+ done ( )
113
+ } )
114
+ . catch ( done )
115
+ } )
116
+
117
+ it ( 'Get installation configuration test' , done => {
118
+ const mock = new MockAdapter ( Axios )
119
+ const uid = installationMock . uid
120
+ mock . onGet ( `/installations/${ uid } /configuration` ) . reply ( 200 , {
121
+ data : { }
122
+ } )
123
+
124
+ makeInstallation ( { data : { uid } } )
125
+ . configuration ( )
126
+ . then ( ( configuration ) => {
127
+ expect ( configuration ) . to . deep . equal ( { } )
120
128
done ( )
121
129
} )
122
130
. catch ( done )
@@ -131,11 +139,7 @@ describe('Contentstack apps installation test', () => {
131
139
makeInstallation ( { data : { uid } } )
132
140
. update ( )
133
141
. then ( ( installation ) => {
134
- expect ( installation . status ) . to . be . equal ( installationMock . status )
135
- expect ( installation . uid ) . to . be . equal ( installationMock . uid )
136
- expect ( installation . organization_uid ) . to . be . equal ( installationMock . organization_uid )
137
- expect ( installation . target . type ) . to . be . equal ( installationMock . target . type )
138
- expect ( installation . target . uid ) . to . be . equal ( installationMock . target . uid )
142
+ checkInstallation ( installation )
139
143
done ( )
140
144
} )
141
145
. catch ( done )
@@ -156,6 +160,14 @@ describe('Contentstack apps installation test', () => {
156
160
} )
157
161
} )
158
162
163
+ function checkInstallation ( installation ) {
164
+ expect ( installation . status ) . to . be . equal ( installationMock . status )
165
+ expect ( installation . uid ) . to . be . equal ( installationMock . uid )
166
+ expect ( installation . organization_uid ) . to . be . equal ( installationMock . organization_uid )
167
+ expect ( installation . target . type ) . to . be . equal ( installationMock . target . type )
168
+ expect ( installation . target . uid ) . to . be . equal ( installationMock . target . uid )
169
+ }
170
+
159
171
function makeInstallation ( data , param = { } ) {
160
172
return new Installation ( Axios , data , param )
161
173
}
0 commit comments