---
title: "Test your integration"
description: "Check language switching, original-language fallback, remote loading, and server rendering."
canonical_url: "https://docs.linguana.dev/docs/automate/test-integration"
markdown_url: "https://docs.linguana.dev/docs/automate/test-integration.md"
x_farming_labs_generated_preamble: true
---

# Test your integration
URL: /docs/automate/test-integration
LLM index: /llms.txt
Description: Check language switching, original-language fallback, remote loading, and server rendering.

# Test your integration

## Required scenarios

1. Render the source locale with only the embedded source catalog.
2. Switch to a loaded target catalog and verify values and rich component slots.
3. Request a missing message and assert source fallback plus one `missing-translation` diagnostic.
4. Provide invalid ICU content and assert source fallback plus `invalid-translation`.
5. Reject remote loading and assert the current/embedded source remains visible plus `catalog-load-failed`.
6. Change locale twice quickly and verify the earlier request is aborted.
7. Verify the `linguana_locale` cookie and optional preference callback.

## SSR precedence

Create requests where override, signed-in preference, cookie, and `Accept-Language` disagree. Assert the first supported match wins in that order, including language-only matching.

## Example diagnostic assertion

```tsx
const diagnostics: DiagnosticEvent[] = [];

render(
  <LocaleProvider {...props} onDiagnostic={(event) => diagnostics.push(event)}>
    <Page />
  </LocaleProvider>,
);

expect(diagnostics[0]?.code).toBe("missing-translation");
```

<ExpectedResult>
Every failure leaves readable content on screen. Diagnostics are sampled by code, locale, and message so repeated renders do not flood telemetry.
</ExpectedResult>

## Next

Use [Catalog runtime troubleshooting](/docs/troubleshooting/catalog-runtime) when a browser test fails, then add the checks to [CI](/docs/automate/ci-cd).

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
