@@ -213,22 +213,25 @@ describe('Attachments Integration Tests --CREATE', () => {
213
213
} ) ;
214
214
} ) ;
215
215
216
- // describe('Attachments Integration Tests --READ', () => {
217
- // it('should read the created attachment', async () => {
218
- // //This test case also reads files not supported by browser (.exe)
219
- // const response = await api.readAttachment(appUrl, serviceName, entityName, incidentID, attachments);
220
- // for(let i = 0; i < attachments.length; i++){
221
- // expect(response[i]).toBe("OK")
222
- // }
223
- // });
224
-
225
- // it('should not read an attachment that doesnt exist', async () => {
226
- // const invalidAttachment = 'invalid-attachment-id';
227
- // const response = await api.readAttachment(appUrl, serviceName, entityName, incidentID, invalidAttachment);
228
- // expect(response.status).toBe("Failed");
229
- // expect(response.message).toBe("Read attachment did not return 200 status code");
230
- // });
231
- // });
216
+ describe ( 'Attachments Integration Tests --READ' , ( ) => {
217
+ it ( 'should read the created attachment' , async ( ) => {
218
+ //This test case also reads files not supported by browser (.exe)
219
+ for ( let i = 0 ; i < attachments . length ; i ++ ) {
220
+ const response = await api . readAttachment ( appUrl , serviceName , entityName , incidentID , attachments [ i ] ) ;
221
+ if ( response . status !== "OK" ) {
222
+ throw new Error ( "Error : " + response . message )
223
+ }
224
+ }
225
+ } ) ;
226
+
227
+ it ( 'should not read an attachment that doesnt exist' , async ( ) => {
228
+ const invalidAttachment = 'invalid-attachment-id' ;
229
+ const response = await api . readAttachment ( appUrl , serviceName , entityName , incidentID , invalidAttachment ) ;
230
+ if ( response . status == "OK" ) {
231
+ throw new Error ( "Error : " + response . message )
232
+ }
233
+ } ) ;
234
+ } ) ;
232
235
233
236
describe ( 'Attachments Integration Tests --UPDATE' , ( ) => {
234
237
let attachment1 ;
0 commit comments