mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
Espelho oficial da agenda em calendário Google compartilhado via API (service account, jose + fetch): reconciliação por passada com id determinístico teqo+base32hex (upsert idempotente, sem estado por evento), hooks afterChange/afterDelete na activity (só campos espelhados, nunca lança), auto-resync quando calendarId muda, retry na view da agenda, pill de estado no header + FAB + diálogo (4 estados). Cancelado no Teqo deleta o evento no Google. Sem participantes no v1 (decisão de produto). Sem migration nova de tabela (hand-written). Closes #635
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import {
|
|
buildGoogleCalendarAddLink,
|
|
buildGoogleCalendarPublicIcalUrl,
|
|
buildGoogleCalendarWebcalUrl,
|
|
} from '@/lib/googleCalendarLink'
|
|
|
|
describe('googleCalendarLink', () => {
|
|
const calendarId = 'c_abc123@group.calendar.google.com'
|
|
|
|
it('builds the webcal subscription URL Apple/Outlook consume', () => {
|
|
expect(buildGoogleCalendarWebcalUrl(calendarId)).toBe(
|
|
'webcal://calendar.google.com/calendar/ical/c_abc123%40group.calendar.google.com/public/basic.ics',
|
|
)
|
|
})
|
|
|
|
it('builds the Google add-by-URL link with the webcal URL as cid', () => {
|
|
const link = buildGoogleCalendarAddLink(calendarId)
|
|
expect(link).toBe(
|
|
'https://calendar.google.com/calendar/r?cid=webcal%3A%2F%2Fcalendar.google.com%2Fcalendar%2Fical%2Fc_abc123%2540group.calendar.google.com%2Fpublic%2Fbasic.ics',
|
|
)
|
|
})
|
|
|
|
it('builds the public HTTPS iCal URL of the same calendar', () => {
|
|
expect(buildGoogleCalendarPublicIcalUrl(calendarId)).toBe(
|
|
'https://calendar.google.com/calendar/ical/c_abc123%40group.calendar.google.com/public/basic.ics',
|
|
)
|
|
})
|
|
})
|