From 41eef29d2411472df74b4fb17b699f79f507c3c6 Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Thu, 30 Jul 2026 10:38:06 +0900 Subject: [PATCH 1/2] feat(user): remove Age Range display, add upgrade-to-paid link for free tier (#476) --- .../app/features/user/components/UserProfileView.tsx | 12 +++++++++++- client/src/locals/en/ui.json | 3 ++- client/src/locals/ja/ui.json | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/client/src/app/features/user/components/UserProfileView.tsx b/client/src/app/features/user/components/UserProfileView.tsx index 058c3ff..36465e9 100644 --- a/client/src/app/features/user/components/UserProfileView.tsx +++ b/client/src/app/features/user/components/UserProfileView.tsx @@ -1,5 +1,6 @@ import { useEffect, useRef, useState } from "react"; import type { FormEvent } from "react"; +import { Link } from "react-router-dom"; import Dialog from "@mui/material/Dialog"; import DialogTitle from "@mui/material/DialogTitle"; import DialogContent from "@mui/material/DialogContent"; @@ -143,8 +144,17 @@ export function UserProfileView({ saveLabel={text.userUpdateSubmit} cancelLabel={text.userUpdateCancel} /> - + {profile.subscriptionTier === "free" && ( +
+ + {text.userUpgradeToPaid} + +
+ )} {deleteError != null && } diff --git a/client/src/locals/en/ui.json b/client/src/locals/en/ui.json index 6cf7dbb..647e9cd 100644 --- a/client/src/locals/en/ui.json +++ b/client/src/locals/en/ui.json @@ -86,5 +86,6 @@ "userDeleteError": "Failed to delete user.", "login": "Login", "loginError": "Failed to log in.", - "logout": "Log out" + "logout": "Log out", + "userUpgradeToPaid": "Upgrade to Paid" } diff --git a/client/src/locals/ja/ui.json b/client/src/locals/ja/ui.json index 5cf8028..facc2df 100644 --- a/client/src/locals/ja/ui.json +++ b/client/src/locals/ja/ui.json @@ -86,5 +86,6 @@ "userDeleteError": "ユーザーの削除に失敗しました。", "login": "ログイン", "loginError": "ログインに失敗しました。", - "logout": "ログアウト" + "logout": "ログアウト", + "userUpgradeToPaid": "有料プランへアップグレード" } From 30b56a8fe162b4ba345403f28dd9b853a71442c8 Mon Sep 17 00:00:00 2001 From: Application-drop-up Date: Thu, 30 Jul 2026 10:38:17 +0900 Subject: [PATCH 2/2] test(user): update UserProfileView tests for removed Age Range and upgrade link --- .../__tests__/UserProfileView.test.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/src/app/features/user/components/__tests__/UserProfileView.test.tsx b/client/src/app/features/user/components/__tests__/UserProfileView.test.tsx index 573ef72..644f851 100644 --- a/client/src/app/features/user/components/__tests__/UserProfileView.test.tsx +++ b/client/src/app/features/user/components/__tests__/UserProfileView.test.tsx @@ -56,18 +56,32 @@ describe("UserProfileView", () => { expect(screen.getByText("First Name")).toBeInTheDocument(); expect(screen.getByText("Last Name")).toBeInTheDocument(); - expect(screen.getByText("Age Range")).toBeInTheDocument(); - expect(screen.getByText("teens")).toBeInTheDocument(); expect(screen.getByText("Subscription")).toBeInTheDocument(); expect(screen.getByText("free")).toBeInTheDocument(); + expect(screen.queryByText("Age Range")).not.toBeInTheDocument(); + expect(screen.queryByText("teens")).not.toBeInTheDocument(); expect(screen.getByRole("button", { name: "Edit First Name" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Edit Last Name" })).toBeInTheDocument(); expect(screen.getByRole("button", { name: "Edit Email" })).toBeInTheDocument(); - expect(screen.queryByRole("button", { name: "Edit Age Range" })).not.toBeInTheDocument(); expect(screen.queryByRole("button", { name: "Edit Subscription" })).not.toBeInTheDocument(); }); + it("shows an upgrade-to-paid link when the subscription tier is free", () => { + renderView(); + + expect(screen.getByRole("link", { name: "Upgrade to Paid" })).toHaveAttribute( + "href", + "/subscription/upgrade", + ); + }); + + it("does not show the upgrade-to-paid link when the subscription tier is paid", () => { + renderView({ profile: { ...profile, subscriptionTier: "paid" } }); + + expect(screen.queryByRole("link", { name: "Upgrade to Paid" })).not.toBeInTheDocument(); + }); + it("turns only the selected field into an input, pre-filled with its current value", () => { renderView();