diff --git a/apps/website/src/components/docs/open-in-cockpit.spec.tsx b/apps/website/src/components/docs/open-in-cockpit.spec.tsx deleted file mode 100644 index aa1236904..000000000 --- a/apps/website/src/components/docs/open-in-cockpit.spec.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { renderToStaticMarkup } from 'react-dom/server'; -import { describe, expect, it } from 'vitest'; -import { resolveDocsBundle } from '../../../../../libs/cockpit-docs/src/index'; -import { OpenInCockpit } from './open-in-cockpit'; - -describe('OpenInCockpit', () => { - it('renders a metadata-driven cockpit link for the current docs bundle', () => { - const bundle = resolveDocsBundle({ - product: 'deep-agents', - section: 'core-capabilities', - topic: 'planning', - page: 'overview', - language: 'python', - }); - - const html = renderToStaticMarkup(); - - expect(html).toContain('/deep-agents/core-capabilities/planning/overview/python'); - }); -}); diff --git a/apps/website/src/components/landing/Differentiator.spec.tsx b/apps/website/src/components/landing/Differentiator.spec.tsx index c9734b948..4713e6eba 100644 --- a/apps/website/src/components/landing/Differentiator.spec.tsx +++ b/apps/website/src/components/landing/Differentiator.spec.tsx @@ -19,25 +19,6 @@ vi.mock('../ui/Section', () => ({ vi.mock('../ui/Eyebrow', () => ({ Eyebrow: ({ children }: { children: React.ReactNode }) => {children}, })); -vi.mock('@ngaf/design-tokens', () => ({ - tokens: { - colors: { - accent: '#7c3aed', - textPrimary: '#111827', - textSecondary: '#6b7280', - textMuted: '#9ca3af', - }, - surfaces: { - border: '#e5e7eb', - }, - typography: { - h2: { family: 'sans-serif', size: '2rem', line: '1.2' }, - bodyLg: { family: 'sans-serif', size: '1.125rem', line: '1.6' }, - body: { family: 'sans-serif', size: '1rem', line: '1.5' }, - fontMono: 'monospace', - }, - }, -})); import { trackCtaClick } from '../../lib/analytics/client'; diff --git a/apps/website/src/lib/docs.spec.ts b/apps/website/src/lib/docs.spec.ts index cd9a17a0a..fcd11cd95 100644 --- a/apps/website/src/lib/docs.spec.ts +++ b/apps/website/src/lib/docs.spec.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import fs from 'fs'; import path from 'path'; +import { fileURLToPath } from 'url'; import { getAllDocSlugs, getDocBySlug, getDocMetadata } from './docs'; import { allDocsPages } from './docs-config'; import { getCanonicalUrl, getSitemapRoutes } from './site-metadata'; @@ -12,7 +13,9 @@ function findInternalDocsLinks(content: string): string[] { .filter((href): href is string => Boolean(href)); } -const contentRoot = path.join(process.cwd(), 'apps', 'website', 'content', 'docs'); +// Resolved relative to this spec file so the path stays correct regardless of +// the runner's cwd (apps/website/ vs workspace root). +const contentRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'content', 'docs'); function walkMdxFiles(dir: string): string[] { return fs.readdirSync(dir).flatMap((entry) => {