Repository navigation
Conversation
Add a repeatable `profile.link` component ({ type, value }, max 10) to
`api::profile.profile`, accept and validate `links` in the user and
organization profile endpoints, and populate it in their responses.
Social types store only the handle; `website`/`other` store a full URL.
The legacy `website`/`github` fields are kept until migrated.
See docs/adr/0003-profile-links.md.
Add vitest to apps/web and apps/cms with a `test` script each and a `test` task in turbo, so `pnpm test` runs something. Pinned to vitest 3, which supports the vite 5 the workspace resolves for the Strapi admin. Cover the new profile links validation (cms) and the existing profile field validation (web).
|
@ayhid is attempting to deploy a commit to the Strapi-Website Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Part 2 of 7 — profile links. Depends on #90 (the cms tests cover code added there). Branched from
feature/profile-links-schema, so until #90 merges this diff also shows its commit — review onlychore: add vitest(95007b7).Summary
Adds a unit-test runner to the monorepo. Today
pnpm testrunsturbo test, but there is notesttask and no framework, so nothing runs.Why
The profile links work adds per-type validation, URL normalization and a data migration — pure logic that's cheap to unit test and easy to get subtly wrong.
Changes
vitest(dev dependency) inapps/webandapps/cms, each with"test": "vitest run"and avitest.config.tsscoped tosrc/**/*.test.ts(so compiled copies indist/are never picked up).testtask inturbo.json.apps/cmscould interfere withstrapi build, so vitest 3 was the safer choice.apps/cms/.../utils/profile-links.test.ts— 16 cases forpickProfileLinks/validateProfileLinks(every type, pasted URLs in handle types, invalid addresses, unknown type, empty value, >10 links, non-array,idstripping).apps/web/.../profile-view/validation.test.ts— existing profile field validation (empty values, length limits, website/github/email formats).No component tests (no Testing Library / jsdom) and no CI step yet — left for a separate decision.
Test plan
pnpm test→ web 4 passed, cms 16 passedpnpm --filter web --filter cms check-typespnpm --filter cms buildapps/webcompiles;next buildthen needs a running CMS forgenerateStaticParams, which is unchanged by this PRFollow-ups
pnpm testin.github/workflows/tests.yml.