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:
@@ -40,7 +40,10 @@ export const ProjectCard = ({
|
|||||||
<div className="project-info-row">
|
<div className="project-info-row">
|
||||||
<button className="project-toggle" onClick={onToggle} type="button" aria-expanded={expanded}>
|
<button className="project-toggle" onClick={onToggle} type="button" aria-expanded={expanded}>
|
||||||
<Icon name={expanded ? "chevron-down" : "chevron-right"} size="sm" />
|
<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 && (
|
{project.repositories?.length > 0 && (
|
||||||
<span className="repo-count">
|
<span className="repo-count">
|
||||||
{project.repositories.length} repo{project.repositories.length > 1 ? "s" : ""}
|
{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 [owner, setOwner] = useState("");
|
||||||
const [repoName, setRepoName] = useState("");
|
const [repoName, setRepoName] = useState("");
|
||||||
const [advancedUrl, setAdvancedUrl] = useState("");
|
const [advancedUrl, setAdvancedUrl] = useState("");
|
||||||
const [useAdvancedUrl, setUseAdvancedUrl] = useState(true);
|
const [useAdvancedUrl, setUseAdvancedUrl] = useState(false);
|
||||||
const [formError, setFormError] = useState<string | null>(null);
|
const [formError, setFormError] = useState<string | null>(null);
|
||||||
const [urlValidation, setUrlValidation] = useState<{
|
const [urlValidation, setUrlValidation] = useState<{
|
||||||
status: UrlValidationStatus;
|
status: UrlValidationStatus;
|
||||||
|
|||||||
@@ -63,7 +63,16 @@ export const ConfigProfilesPage = () => {
|
|||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
if (isCreating) {
|
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([]);
|
setIncludedProfileIds([]);
|
||||||
setSaveStatus("idle");
|
setSaveStatus("idle");
|
||||||
} else if (selectedProfile) {
|
} 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 === "loading")
|
||||||
if (status === "error") return <div className="container"><ErrorState message="Failed to load Config Profiles." onRetry={loadData} /></div>;
|
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) {
|
if (isMobile) {
|
||||||
return (
|
return (
|
||||||
@@ -97,7 +119,12 @@ export const ConfigProfilesPage = () => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="container"
|
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
|
<ConfigProfileListSidebar
|
||||||
profiles={profiles}
|
profiles={profiles}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ describe("HomePage", () => {
|
|||||||
expect(screen.getByText("Loading overview...")).toBeInTheDocument();
|
expect(screen.getByText("Loading overview...")).toBeInTheDocument();
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getAllByText("Open sessions").length).toBeGreaterThan(0);
|
expect(screen.getAllByText("Open sessions").length).toBeGreaterThan(0);
|
||||||
expect(screen.getByText("Available projects")).toBeInTheDocument();
|
expect(screen.getByText("Workspaces")).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user