Skip to content

test(integrations): jest coverage for leaf chain (CnIntegrationTab + Card + 18 leaves)#232

Merged
rubenvdlinde merged 1 commit into
betafrom
hotfix/integration-leaves-fleet-tests
May 15, 2026
Merged

test(integrations): jest coverage for leaf chain (CnIntegrationTab + Card + 18 leaves)#232
rubenvdlinde merged 1 commit into
betafrom
hotfix/integration-leaves-fleet-tests

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

Follow-up to nc-vue#231 — adds jest test coverage for the components and registrations that landed in #231.

Three specs

  • tests/integrations/leaves.spec.js — 12 tests covering the 18 leaf descriptors + registerLeafIntegrations() (parity gate, collision policy, idempotence, PHP-side parity).
  • tests/components/CnIntegrationTab.spec.js — 12 tests covering the generic sidebar tab (mount fetch, empty / 503 / 501 / network-error paths, DELETE on unlink, allowUnlink toggle, integrationId reactivity).
  • tests/components/CnIntegrationCard.spec.js — 15 tests covering the 4-surface widget (detail-page list, dashboard compact list COMPACT_LIMIT=5, single-entity chip with title/subtitle/url, reactivity, title fallback).

Quality

  • 53 new tests, all pass locally.
  • Full nc-vue jest run is green (1347 / 1347).
  • No production code touched — pure test additions.

…b + Card + 18 leaves)

Three jest specs landing on top of nc-vue#231 (merged to beta):

  tests/integrations/leaves.spec.js (12 tests)
    - 18 leaf descriptors present + parity gate (tab + widget per leaf)
    - id/group/requiredApp matches PHP-side provider table
    - referenceType === id for AD-18 crossover
    - order numbers cluster by group (comms/external/docs/workflow/core)
    - every leaf shares the same generic Tab + Card
    - registerLeafIntegrations onto fresh registry, returns 18 new ids
    - collision policy: existing 'calendar' override wins (AD-13)
    - idempotent on repeated calls

  tests/components/CnIntegrationTab.spec.js (12 tests)
    - mount + fetch from /api/.../integrations/{id} on mount
    - empty / 503 / non-200 / network-error rendering paths
    - DELETE on unlink button + 'unlinked' event emission
    - 501 surfaces 'not supported' inline error
    - 503 on unlink flips the degraded banner
    - allowUnlink=false hides the unlink button
    - integrationId change refetches with new URL
    - breadcrumb-derived subtitle when row has breadcrumb array

  tests/components/CnIntegrationCard.spec.js (15 tests)
    - detail-page: full list rendering
    - user/app-dashboard: COMPACT_LIMIT=5 cap
    - single-entity: fetches /integrations/{id}/{value} endpoint,
      renders chip with title + subtitle + optional external url anchor
    - empty / 503 fallbacks per surface
    - reactivity: refetches on surface flip + integrationId change
    - title-prop fallback to integrationId when empty

53 tests pass; full nc-vue jest run is green (1347 / 1347).
Copy link
Copy Markdown

@WilcoLouwerse WilcoLouwerse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Minor

  • 🟢 Singleton default test asserts almost nothing
  • 🟢 single-entity 503 test only checks chip absence, not unavailable label render
  • 🟢 Reactivity surface-flip test encodes an accepted double-fetch without an upper bound

@rubenvdlinde rubenvdlinde merged commit e43bdda into beta May 15, 2026
3 checks passed
@rubenvdlinde rubenvdlinde deleted the hotfix/integration-leaves-fleet-tests branch May 15, 2026 14:50
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0-beta.45 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants