test(ci): add exporter heading levels and a11y typography smoke; update MAIN_PLAN
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { generateAppsScriptTemplate } from '@/lib/integrations/sheets'
|
||||
|
||||
describe('Google Sheets Apps Script 템플릿', () => {
|
||||
it('시트 ID와 허용 오리진으로 Apps Script 코드와 가이드를 생성한다', () => {
|
||||
const out = generateAppsScriptTemplate({
|
||||
sheetId: '1AbcDEFghiJKL_sheet_id',
|
||||
allowedOrigins: ['https://example.com', 'http://localhost:3000'],
|
||||
minSubmitSeconds: 2,
|
||||
honeypotFieldName: '_hp',
|
||||
sheetName: 'Responses',
|
||||
})
|
||||
|
||||
expect(typeof out.code).toBe('string')
|
||||
expect(typeof out.readme).toBe('string')
|
||||
|
||||
// 필수 키워드 포함 검증
|
||||
expect(out.code).toContain('function doPost(e)')
|
||||
expect(out.code).toContain('SpreadsheetApp.openById')
|
||||
expect(out.code).toContain('e.postData')
|
||||
expect(out.code).toContain('ContentService.createTextOutput')
|
||||
expect(out.code).toContain('Access-Control-Allow-Origin')
|
||||
|
||||
// 환경설정 치환값 반영
|
||||
expect(out.code).toContain('1AbcDEFghiJKL_sheet_id')
|
||||
expect(out.code).toContain('Responses')
|
||||
expect(out.code).toContain('_hp')
|
||||
expect(out.code).toContain('minSubmitSeconds')
|
||||
|
||||
// 배포 가이드에 웹 앱 배포 안내 포함
|
||||
expect(out.readme).toMatch(/Deploy.*as Web app/i)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user