test (calendar.test.js): Check if the file was created in the test directory

This commit is contained in:
Ryan Mwangi 2024-11-05 13:43:22 +03:00
parent e44f8bf474
commit 54d3a35c43
1 changed files with 8 additions and 8 deletions

View File

@ -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);
});