Skip to content

Testing Your Changes

Test in the editor first, then verify with DevTools in the shadow root, then run the compliance checker before saving.

The Kookiok admin editor embeds a live preview iframe that loads the real consent-runtime.js from the backend in preview mode. This means:

  • The DOM structure is identical to what visitors see.
  • Token overrides apply in real time.
  • The compliance checker runs against the same rules as the server.

The editor preview is the most reliable tool for banner testing. Use it as your first stop.

  1. Paste or type your custom CSS in the editor.

  2. Click Check compliance (or wait for the auto-check debounce).

  3. Read the results:

    • No violations — safe to save.
    • Warnings — advisory; save is allowed, but review before deploying.
    • Errors — the save will be rejected (or the rule is enforced runtime). Fix before saving.
  4. For each violation, click the rule ID link to read the full explanation in the compliance rules reference.

  1. Open your site (or the editor preview iframe URL directly) in Chrome or Firefox.

  2. Open DevTools (F12).

  3. In the Elements panel, find:

    <div id="__AG_CONSENT_HOST__">
    #shadow-root (open)
    .ag-overlay
    .ag-banner
    ...
  4. Click into the shadow root to browse elements. The Styles panel shows which CSS rule is currently winning for the selected element.

  5. To test CSS changes interactively, select an element and add declarations in the Styles panel. Copy the final CSS back to the editor.

  1. In DevTools, select .ag-banner.
  2. In the Styles panel, find the color and background-color values.
  3. Click the color chip — DevTools shows the contrast ratio for text vs background.
  4. Aim for ≥ 4.5:1 for body text, ≥ 3:1 for large headings.

Alternatively, use WebAIM Contrast Checker with the exact hex values from your token overrides.

  1. Dismiss any open dialogs on your page.
  2. Press Tab until focus reaches the banner.
  3. Verify focus is visible (outline, not just a faint change).
  4. Tab through all interactive elements: Reject, Accept, Customize button, category chips.
  5. Press Enter on Reject — banner should dismiss and preference should be recorded.

Use Chrome DevTools device emulation (Ctrl+Shift+M) to test at common mobile widths (375px, 390px, 414px). Verify:

  • All three buttons are visible and tappable.
  • Text is readable (not clipped or overflowing).
  • The overlay covers the full viewport.
  • The banner does not cover the full screen, leaving room for interaction awareness.
  • Live preview looks correct in all supported templates.
  • Compliance checker shows 0 errors.
  • Contrast ≥ 4.5:1 for body text.
  • All three buttons visible and accessible on mobile (375px width).
  • Focus rings visible on keyboard navigation.
  • prefers-reduced-motion test: animation disabled.
  • CSS saved successfully (no HTTP 422 response).