From 54d3a35c43365bc2226093e2d92b25b1feb4b12e Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Tue, 5 Nov 2024 13:43:22 +0300 Subject: [PATCH] test (calendar.test.js): Check if the file was created in the test directory --- calendar.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/calendar.test.js b/calendar.test.js index 34f44cb..ca2044e 100644 --- a/calendar.test.js +++ b/calendar.test.js @@ -54,8 +54,8 @@ describe('Calendar Merging API', () => { expect(response.status).toBe(200); expect(response.body.url).toMatch(/calendar\/Date_Based_Calendar/); - // Check if the file was created - const filePath = path.join(MERGED_CALENDARS_DIR, 'Date_Based_Calendar.ics'); + // Check if the file was created in the test directory + const filePath = path.join(TEST_MERGED_CALENDARS_DIR, 'Date_Based_Calendar.ics'); expect(fs.existsSync(filePath)).toBe(true); }); @@ -81,8 +81,8 @@ describe('Calendar Merging API', () => { expect(response.status).toBe(200); expect(response.body.url).toMatch(/calendar\/Time_Based_Calendar/); - // Check if the file was created - const filePath = path.join(MERGED_CALENDARS_DIR, 'Time_Based_Calendar.ics'); + // Check if the file was created in the test directory + const filePath = path.join(TEST_MERGED_CALENDARS_DIR, 'Time_Based_Calendar.ics'); expect(fs.existsSync(filePath)).toBe(true); }); @@ -103,8 +103,8 @@ describe('Calendar Merging API', () => { expect(response.status).toBe(200); expect(response.body.url).toMatch(/calendar\/No_Prefix_Calendar/); - // Check if the file was created - const filePath = path.join(MERGED_CALENDARS_DIR, 'No_Prefix_Calendar.ics'); + // Check if the file was created in the test directory + const filePath = path.join(MTEST_MERGED_CALENDARS_DIR, 'No_Prefix_Calendar.ics'); expect(fs.existsSync(filePath)).toBe(true); }); @@ -125,8 +125,8 @@ describe('Calendar Merging API', () => { expect(response.status).toBe(200); expect(response.body.url).toMatch(/calendar\/Override_Calendar/); - // Check if the file was created - const filePath = path.join(MERGED_CALENDARS_DIR, 'Override_Calendar.ics'); + // Check if the file was created in the test directory + const filePath = path.join(TEST_MERGED_CALENDARS_DIR, 'Override_Calendar.ics'); expect(fs.existsSync(filePath)).toBe(true); });