Skip to content

Testing an integration ​

Celerik's own test suites prove that the components work. They cannot prove that your application wires them correctly: routes, CSRF, authorization, asset paths, time zones, themes and your Content Security Policy live in your code.

Test in this order. Each layer catches problems the previous one cannot see. Step-by-step guides and ready-made scripts are in the celerik-doc repository.

#LayerCatchesGuide
1Unit and component testsLogic and rendering bugsTest suites
2HTTP checksEndpoint contracts, CSRF, validation, authorization, stored dataHTTP checks
3Browser checksMissing assets, wrong chunk paths, JavaScript errors, components that never startBrowser checks
4Accessibility in a browserContrast and markup issues that only appear once libraries have rendered, in your themeAccessibility
5Content Security PolicyInline scripts or styles your policy blocksCSP
6SecurityUpload, rich text and File Manager attacksSecurity

The scripts ​

ScriptDoes
check-page.shLoads a page in headless Edge or Chrome (its own profile) and prints the components that started, axe-core violations, console errors and CSP violations.
browser-check.jsAppended to a test page, it waits for every component and runs axe-core with colour contrast.
elfinder-security.phpSends attack requests to your File Manager connector and reports which were refused.
make-test-files.phpWrites valid and malicious sample uploads.

Your theme ​

A custom theme is your code too. Check it before it ships:

bash
vendor/bin/celerik-theme check theme.json      # every contrast pair, exit 1 on a failure

Then load a page that uses it in light and dark mode with check-page.sh: axe-core checks the contrast of the rendered components, which the token check cannot see (for example text on a coloured calendar event).

Checklist ​

Copy this into your pull request or release notes.

  • Assets: Bootstrap 5.3 (CSS and bootstrap.bundle.js) and jQuery 3.7 load before the Celerik tags; the whole public/ folder is published, chunks/ included, again after every update; the base theme and your custom theme load in that order.
  • Endpoints: each endpoint uses the same component definition as its page (respond()); endpoints are behind authorization; JSON changes check the CSRF token; bad input answers 400 or 422 with a message.
  • Data: dates are converted to the right time zone before saving; uploads are claimed or stored outside the web root, and purge() runs from a cron job; editor HTML is sanitized with EditorHtml::sanitize().
  • Browser: every component starts, with no console errors; no axe-core violations in each theme and mode; Tab order, Escape in dialogs, arrow keys in tabs, and the calendar's event dialog work from the keyboard; your production CSP reports no violations.
  • Theme: celerik-theme check passes; the ThemeBuilder, if deployed, is behind authorization or local only.
  • File Manager (if used): its root is outside the web root, one per tenant or user when files are private; elfinder-security.php reports every attack refused; composer audit is clean.

Released under the MIT License.