test(integrations): jest coverage for leaf chain (CnIntegrationTab + Card + 18 leaves)#232
Merged
Merged
Conversation
…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).
WilcoLouwerse
left a comment
There was a problem hiding this comment.
🟢 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
Contributor
|
🎉 This PR is included in version 1.0.0-beta.45 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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