Repository navigation
feat(testimonials): add member testimonial authoring UI - #1494
Merged
Merged
Conversation
Members can write, edit, submit, and delete draft testimonials at /User/MyProfile/Testimonials. Each testimonial shows its status and any reviewer feedback, and becomes read-only once submitted. - Testimonials module: public ITestimonialAuthoring use cases scoped by memberId, a dependency-free TestimonialOperationResult, shared TestimonialLimits, and field-level input validation. - Web: Index and Edit Razor pages plus a My Profile card. - Tests: module service tests, and authenticated functional tests that use a header-based test auth scheme. - Fix CustomWebApplicationFactory so the in-memory app and identity DBs persist across scopes, making seed data visible to requests. Fixes #1490 Relates to #1472 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| Assert.True(match.Success, $"No antiforgery token found on {formPageUrl}."); | ||
|
|
||
| var form = new Dictionary<string, string>(fields) { ["__RequestVerificationToken"] = match.Groups[1].Value }; | ||
| return await client.PostAsync(postUrl, new FormUrlEncodedContent(form)); |
| } | ||
|
|
||
| /// <param name="Field">The <see cref="TestimonialDraftInput"/> property name, or null for a general error.</param> | ||
| public sealed record TestimonialValidationError(string? Field, string Message); |
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.
Fixes #1490
Relates to #1472
Summary
Members can now write and manage their own testimonials at My Profile → Testimonials (
/User/MyProfile/Testimonials).Testimonials module
ITestimonialAuthoring(Contracts) is the member-facing set of use cases: list, get, create a draft, update, submit, and delete a draft. Every call is scoped bymemberId. Another member's testimonial is reported as not found.TestimonialOperationResultreturnsSuccess,NotFound,NotAllowed, orInvalidwith field errors. It is a small local type, so Contracts stays dependency-free.TestimonialLimits: field max lengths now live in Contracts so the web forms can validate up front. The domain constants point at them.TestimonialAuthoringvalidates input into field-level errors, then calls the domain. It maps illegal state transitions and concurrency conflicts toNotAllowed. The clock comes fromTimeProvider.MemberTestimonialDtoexposesCanEdit,CanSubmit, andCanDelete, plus reviewer feedback. Feedback is shown for ChangesRequested and Declined.Web
Testimonials/Indexlists the member's testimonials with a status badge, an explanation, and reviewer feedback. It has Edit/View, Submit for review, and Delete draft (drafts only, with a confirmation) actions.Testimonials/Edit/{id?}creates or edits: the text, plus display name (prefilled from the member's name), title, organization, and an optional https photo URL that falls back to the avatar. It has Save draft and Save and submit for review buttons.Test infrastructure
AuthenticatedWebApplicationFactoryandTestAuthHandler. The handler is a header-based scheme, so functional tests can sign in as a seeded member.CustomWebApplicationFactory. It built a new EF internal service provider inside theAddDbContextoptions callback, which runs once per scope. Every request scope therefore saw an empty in-memory app/identity database, and the seed data was effectively invisible. Each provider is now built once, the same way the testimonials registration already did it.InternalsVisibleToto the functional tests, so they can apply admin review transitions until the admin queue (Testimonials: admin review queue #1491) exists.Tests
DevBetterWeb.Modules.Testimonials.Tests/Application/TestimonialAuthoringTests) covers:javascript:photo URLs), and over-long fieldsDevBetterWeb.FunctionalTests/RazorPages/Testimonials/MyTestimonialsPages) covers:Verification
dotnet build: 0 errors.dotnet test: all suites pass (Modules.Testimonials 101, Tests 118, UnitTests 195, AppHost 4, Functional 19).dotnet format --verify-no-changes --include <touched files>: clean. The repo-wide format failures were already onmainand are not touched here..claude/plans/2026-11-16-issue-1490-testimonials-member-authoring.md.Deploy notes
🤖 Generated with Claude Code