mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-17 12:43:05 +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
33 lines
1.5 KiB
TypeScript
33 lines
1.5 KiB
TypeScript
import { campaignPageChrome, expect, test } from './fixtures/campaignE2EFixtures.js'
|
|
|
|
/**
|
|
* C114 — Google Calendar mirror surface on the agenda. The e2e only pins the
|
|
* deterministic "não configurado" state (no credential env in the test
|
|
* runtime, no sync doc in the seeded DB): engine behavior (create/update/
|
|
* delete/recover) is covered by the int tests with an in-memory calendar
|
|
* stub — this spec must never depend on the real Google API.
|
|
*/
|
|
test.describe('Agenda — sincronização Google (C114)', () => {
|
|
test('staff vê a pill "não configurado" e o diálogo explica o passo de operação', async ({
|
|
campaign,
|
|
page,
|
|
}) => {
|
|
const { fixtures } = campaign
|
|
const coordinator = await fixtures.createCampaignUser('coordinator')
|
|
|
|
await campaign.login(page, coordinator.email!, coordinator.password)
|
|
await page.goto(`${campaign.baseURL}/campanha/agenda`)
|
|
|
|
await expect(campaignPageChrome(page, 'Agenda')).toBeVisible()
|
|
|
|
const pill = page.getByRole('button', { name: 'Google: não configurado' })
|
|
await expect(pill).toBeVisible({ timeout: 15_000 })
|
|
await pill.click()
|
|
|
|
const dialog = page.getByRole('dialog', { name: /Agenda da Campanha no Google/ })
|
|
await expect(dialog).toBeVisible()
|
|
await expect(dialog.getByText('Ainda não configurado')).toBeVisible()
|
|
// O runbook de operação aparece (a ativação depende da conta Google da campanha).
|
|
await expect(dialog.getByText(/service account do Teqo/)).toBeVisible()
|
|
})
|
|
})
|