Skip to content

Commit f07a258

Browse files
added read test cases
1 parent 4b5d7da commit f07a258

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

test/integration/attachments-sdm.test.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,25 @@ describe('Attachments Integration Tests --CREATE', () => {
213213
});
214214
});
215215

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+
});
232235

233236
describe('Attachments Integration Tests --UPDATE', () => {
234237
let attachment1;

0 commit comments

Comments
 (0)