ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/components/__tests__/json-ld.test.tsx

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/components/__tests__/json-ld.test.tsx
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/components/__tests__/json-ld.test.tsx
Original SHA-25677bf53ed3e469ed5e140547f8a616261310498f891a132c421a11b5c6aa27db4
Git blob SHAa41cd15a58fe304e23051ddc89716d9a77c7c39b
Reading-copy SHA-25677bf53ed3e469ed5e140547f8a616261310498f891a132c421a11b5c6aa27db4

Original source ↗

Recovered source transcript

import { headers } from 'next/headers' import React from 'react' import { JsonLd } from '@/components/json-ld' jest.mock('next/headers', () => ({ headers: jest.fn() })) describe('JsonLd', () => { const mockedHeaders = headers as jest.MockedFunction<typeof headers> beforeEach(() => { jest.clearAllMocks() }) it('marks nonce-backed JSON-LD scripts to suppress hydration mismatches', async () => { mockedHeaders.mockResolvedValue( new Headers({ 'x-nonce': 'test-nonce' }) as Awaited<ReturnType<typeof headers>> ) const scriptElement = await JsonLd({ data: { '@context': 'https://schema.org', name: 'Example <script>alert(1)</script>' } }) expect(React.isValidElement(scriptElement)).toBe(true) expect(scriptElement.props.nonce).toBe('test-nonce') expect(scriptElement.props.suppressHydrationWarning).toBe(true) expect(scriptElement.props.dangerouslySetInnerHTML.__html).toContain('\\u003cscript>') }) })

Search equations, builds, manuscript text, and recovered sources.