Files
Sauci/apps/web/public/.well-known/well-known.test.ts
T
jjbruntonandClaude Fable 5 4f9950f21b feat(invite-funnel): set real Android app signing cert fingerprint
Replace the assetlinks.json placeholder with the Play App Signing key
SHA-256 certificate fingerprint so Android App Links for
https://sauci.app/join/* can verify.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-30 18:06:42 +01:00

31 lines
1.2 KiB
TypeScript

import { readFile } from 'node:fs/promises'
import { describe, expect, it } from 'vitest'
const aasaPath = new URL('./apple-app-site-association', import.meta.url)
const assetlinksPath = new URL('./assetlinks.json', import.meta.url)
describe('apple-app-site-association', () => {
it('is valid JSON that covers /join/*', async () => {
const raw = await readFile(aasaPath, 'utf8')
const data = JSON.parse(raw)
expect(data.applinks.details).toHaveLength(1)
expect(data.applinks.details[0].paths).toContain('/join/*')
// com.sauci.app matches apps/mobile/app.json ios.bundleIdentifier.
expect(data.applinks.details[0].appID).toMatch(/\.com\.sauci\.app$/)
})
})
describe('assetlinks.json', () => {
it('is valid JSON that targets the Android package', async () => {
const raw = await readFile(assetlinksPath, 'utf8')
const data = JSON.parse(raw)
expect(data[0].target.package_name).toBe('com.sauci.app')
expect(data[0].target.namespace).toBe('android_app')
// Must be the Play App Signing key certificate fingerprint (Play Console >
// Test and release > Setup > App signing), colon-separated uppercase hex.
expect(data[0].target.sha256_cert_fingerprints[0]).toMatch(/^([0-9A-F]{2}:){31}[0-9A-F]{2}$/)
})
})