Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/__tests__/identity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,16 @@ describe('identity copy', () => {
expect(contact).toContain('min-width: 44px');
});

it('exposes window.posthog after idle init so hire Contact card can capture (#hire-ph)', () => {
const ph = readFileSync('src/components/PostHog.astro', 'utf8');
expect(ph).toContain("await import('posthog-js')");
expect(ph).toContain('posthog.init(');
expect(ph).toMatch(/window\.posthog\s*=\s*posthog/);
expect(ph).toContain('PUBLIC_POSTHOG_KEY');
expect(ph).toContain('requestIdleCallback');
expect(ph).not.toMatch(/^import\s+.*from\s+['"]posthog-js['"]/m);
});

it('footer colophon has no visitor visit-count control (#1045)', () => {
const footer = readFileSync('src/components/Footer.astro', 'utf8');
expect(footer).toContain('class="colophon"');
Expand Down
1 change: 1 addition & 0 deletions src/components/PostHog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
api_host: posthogHost,
person_profiles: 'identified_only',
});
window.posthog = posthog;
}

const scheduleIdle =
Expand Down
Loading