test:update test forhandling timezones
This commit is contained in:
parent
2e9de0749d
commit
cbdfdf6c97
|
@ -120,6 +120,34 @@ describe('Calendar Merging API', () => {
|
||||||
expect(actualOutput).toBe(expectedOutput);
|
expect(actualOutput).toBe(expectedOutput);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('EAT Event', async () => {
|
||||||
|
const input = loadCalendarFile('eat_time_zone_event.ics');
|
||||||
|
const response = await request(server)
|
||||||
|
.post('/merge')
|
||||||
|
.send({
|
||||||
|
linkGroupName: 'EAT Event',
|
||||||
|
calendars: [
|
||||||
|
{
|
||||||
|
url: input,
|
||||||
|
prefix: 'EAT Event',
|
||||||
|
override: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(response.status).toBe(200);
|
||||||
|
expect(response.body.url).toMatch(/calendar\/EAT_Event/);
|
||||||
|
|
||||||
|
// Check if the file was created in the test directory
|
||||||
|
const filePath = path.join(CALENDARS_DIR, 'EAT_Event.ics');
|
||||||
|
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 calendar without prefix', async () => {
|
// test('Merge calendar without prefix', async () => {
|
||||||
// const response = await request(server)
|
// const response = await request(server)
|
||||||
// .post('/merge')
|
// .post('/merge')
|
||||||
|
|
|
@ -1,15 +1,11 @@
|
||||||
BEGIN:VCALENDAR
|
BEGIN:VCALENDAR
|
||||||
|
NAME:EAT Event
|
||||||
VERSION:2.0
|
VERSION:2.0
|
||||||
PRODID:-//Example Corp//NONSGML Event//EN
|
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
UID:20231108T090000+0300-001@example.com
|
UID:20231108T090000+0300-001@example.com
|
||||||
DTSTAMP:20231108T090000+0300
|
DTSTAMP:20231108T090000+0300
|
||||||
DTSTART:20231108T090000+0300
|
DTSTART:20231108T090000+0300
|
||||||
DTEND:20231108T100000+0300
|
DTEND:20231108T100000+0300
|
||||||
SUMMARY:EAT Event
|
SUMMARY:EAT Event
|
||||||
DESCRIPTION:This event is scheduled in East Africa Time (UTC+3).
|
|
||||||
LOCATION:Virtual
|
|
||||||
STATUS:CONFIRMED
|
|
||||||
SEQUENCE:0
|
|
||||||
END:VEVENT
|
END:VEVENT
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
Loading…
Reference in New Issue