Compare commits
No commits in common. "0b0ecaa0c208bebe1a10a2a980810bc9b9cb2435" and "441f4d2fb3afce69dd59eb99403d75a126975f51" have entirely different histories.
0b0ecaa0c2
...
441f4d2fb3
|
@ -34,31 +34,6 @@ describe('Calendar Merging API', () => {
|
||||||
return fs.readFileSync(path.join(EXPECTED_OUTPUTS_DIR, filename), 'utf8');
|
return fs.readFileSync(path.join(EXPECTED_OUTPUTS_DIR, filename), 'utf8');
|
||||||
};
|
};
|
||||||
|
|
||||||
test('Preserve date-based calendar', async () => {
|
|
||||||
const input = loadCalendarFile('US_Holidays.ics');
|
|
||||||
const response = await request(server)
|
|
||||||
.post('/merge')
|
|
||||||
.send({
|
|
||||||
linkGroupName: 'US Holidays',
|
|
||||||
calendars: [
|
|
||||||
{
|
|
||||||
url: input,
|
|
||||||
prefix: '',
|
|
||||||
override: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
expect(response.status).toBe(200);
|
|
||||||
// Check if the file was created in the test directory
|
|
||||||
const filePath = path.join(CALENDARS_DIR, 'US_Holidays.ics');
|
|
||||||
console.log('Checking if file exists at:', filePath);
|
|
||||||
expect(fs.existsSync(filePath)).toBe(true);
|
|
||||||
// Load expected output and compare
|
|
||||||
const expectedOutput = fs.readFileSync(input, 'utf8');
|
|
||||||
const actualOutput = fs.readFileSync(filePath, 'utf8');
|
|
||||||
expect(actualOutput).toBe(expectedOutput);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Merge date-based calendar', async () => {
|
test('Merge date-based calendar', async () => {
|
||||||
const response = await request(server)
|
const response = await request(server)
|
||||||
.post('/merge')
|
.post('/merge')
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
BEGIN:VCALENDAR
|
BEGIN:VCALENDAR
|
||||||
|
PRODID:-//Your Product ID//EN
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
NAME:Date Based Calendar
|
NAME:Date Based Calendar
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
|
@ -13,4 +14,4 @@ SUMMARY:US_holidays Christmas Day
|
||||||
DTSTART:20231225T000000
|
DTSTART:20231225T000000
|
||||||
DTEND:20231226T000000
|
DTEND:20231226T000000
|
||||||
END:VEVENT
|
END:VEVENT
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
|
@ -1,11 +1,15 @@
|
||||||
BEGIN:VCALENDAR
|
BEGIN:VCALENDAR
|
||||||
NAME:US Holidays
|
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
|
PRODID:-//Example Corp//NONSGML Event//EN
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
UID:20231225T000000-001@example.com
|
UID:20231225T000000-001@example.com
|
||||||
DTSTAMP:20231225T000000Z
|
DTSTAMP:20231225T000000Z
|
||||||
DTSTART;VALUE=DATE:20231225
|
DTSTART;VALUE=DATE:20231225
|
||||||
DTEND;VALUE=DATE:20231226
|
DTEND;VALUE=DATE:20231226
|
||||||
SUMMARY:Christmas Day
|
SUMMARY:Christmas Day
|
||||||
|
DESCRIPTION:Public holiday for Christmas in The US.
|
||||||
|
LOCATION:San Francisco
|
||||||
|
STATUS:CONFIRMED
|
||||||
|
SEQUENCE:0
|
||||||
END:VEVENT
|
END:VEVENT
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
|
Loading…
Reference in New Issue