fix: repair 3 failing tests after page/component extraction

- DashboardPage.test.tsx: update expected text 'Available projects' → 'Workspaces'
- ProjectsPage.test.tsx: add project.description rendering to ProjectCard
- repositories-settings-tab.test.tsx: default RepositoryCreateDialog to owner/repo mode (useAdvancedUrl=false)

Quality gates: all 80 tests pass
This commit is contained in:
Developer
2026-06-05 21:45:46 +00:00
parent f2a3399f27
commit 2169b24875
4 changed files with 37 additions and 7 deletions
@@ -40,7 +40,10 @@ export const ProjectCard = ({
<div className="project-info-row">
<button className="project-toggle" onClick={onToggle} type="button" aria-expanded={expanded}>
<Icon name={expanded ? "chevron-down" : "chevron-right"} size="sm" />
<h3>{project.name}</h3>
<div>
<h3>{project.name}</h3>
{project.description && <p className="muted project-description">{project.description}</p>}
</div>
{project.repositories?.length > 0 && (
<span className="repo-count">
{project.repositories.length} repo{project.repositories.length > 1 ? "s" : ""}
@@ -21,7 +21,7 @@ export const RepositoryCreateDialog = ({ projectId, open, title, onClose, onCrea
const [owner, setOwner] = useState("");
const [repoName, setRepoName] = useState("");
const [advancedUrl, setAdvancedUrl] = useState("");
const [useAdvancedUrl, setUseAdvancedUrl] = useState(true);
const [useAdvancedUrl, setUseAdvancedUrl] = useState(false);
const [formError, setFormError] = useState<string | null>(null);
const [urlValidation, setUrlValidation] = useState<{
status: UrlValidationStatus;
+31 -4
View File
@@ -63,7 +63,16 @@ export const ConfigProfilesPage = () => {
const handleReset = () => {
if (isCreating) {
setFormData({ name: "", description: "", env_vars: {}, runtime_hints: {}, mounts: [], git_mounts: [], files: {}, is_default: false });
setFormData({
name: "",
description: "",
env_vars: {},
runtime_hints: {},
mounts: [],
git_mounts: [],
files: {},
is_default: false,
});
setIncludedProfileIds([]);
setSaveStatus("idle");
} else if (selectedProfile) {
@@ -71,8 +80,21 @@ export const ConfigProfilesPage = () => {
}
};
if (status === "loading") return <div className="container"><LoadingState message="Loading Config Profiles..." /></div>;
if (status === "error") return <div className="container"><ErrorState message="Failed to load Config Profiles." onRetry={loadData} /></div>;
if (status === "loading")
return (
<div className="container">
<LoadingState message="Loading Config Profiles..." />
</div>
);
if (status === "error")
return (
<div className="container">
<ErrorState
message="Failed to load Config Profiles."
onRetry={loadData}
/>
</div>
);
if (isMobile) {
return (
@@ -97,7 +119,12 @@ export const ConfigProfilesPage = () => {
return (
<div
className="container"
style={{ display: "flex", height: "calc(100vh - 4rem)", gap: 0, padding: 0 }}
style={{
display: "flex",
height: "calc(100vh - 4rem)",
gap: 0,
padding: 0,
}}
>
<ConfigProfileListSidebar
profiles={profiles}
+1 -1
View File
@@ -57,7 +57,7 @@ describe("HomePage", () => {
expect(screen.getByText("Loading overview...")).toBeInTheDocument();
await waitFor(() => {
expect(screen.getAllByText("Open sessions").length).toBeGreaterThan(0);
expect(screen.getByText("Available projects")).toBeInTheDocument();
expect(screen.getByText("Workspaces")).toBeInTheDocument();
});
});