Skip to Content
Quality AssuranceTestsIntegrationsSuiteSluggable Trait Test Suite Documentation

Sluggable Trait Test Suite Documentation

Overview

This Jest test suite validates the presence of the sluggable trait within the API responses for all entities defined in the metadata-cache.json. It ensures that the slug field is consistently provided to support SEO-friendly URLs and slug-based lookups.

Test Scope

  • Iterates over all entities defined in the metadata cache.
  • For each entity, it performs GET requests to the listing, detail, and dropdown endpoints.
  • It verifies that the slug field is present in all three response types:
    • Listing
    • Detail
    • Dropdown

Environmental Setup

  • Uses environment variable:
    • PHPR_BASE_URL - Base URL for API requests.
  • Loads entity information from metadata-cache.json.

Notes

  • The slug field is essential for creating readable URLs.
  • These tests ensure that the slug is consistently available across different API access points (list, detail, and dropdown).
Last updated on