mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-02 18:20:29 +08:00
Don't push empty project description to page title
This commit is contained in:
@@ -943,7 +943,9 @@ export function projectTitle(loadedRoute: ProjectLoadedRoute) {
|
||||
|
||||
if (loadedRoute.resource === "project.source") {
|
||||
title.push(loadedRoute.params.project.name);
|
||||
title.push(loadedRoute.params.project.description);
|
||||
if (loadedRoute.params.project.description.length > 0) {
|
||||
title.push(loadedRoute.params.project.description);
|
||||
}
|
||||
} else if (loadedRoute.resource === "project.commit") {
|
||||
title.push(loadedRoute.params.commit.commit.summary);
|
||||
title.push("commit");
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
sourceBrowsingUrl,
|
||||
test,
|
||||
} from "@tests/support/fixtures.js";
|
||||
import { createProject } from "@tests/support/project";
|
||||
import {
|
||||
expectBackAndForwardNavigationWorks,
|
||||
expectUrlPersistsReload,
|
||||
@@ -112,6 +113,30 @@ test.describe("project page navigation", () => {
|
||||
await expectUrlPersistsReload(page);
|
||||
});
|
||||
|
||||
test("page title", async ({ page }) => {
|
||||
await page.goto(sourceBrowsingUrl, {
|
||||
waitUntil: "networkidle",
|
||||
});
|
||||
const title = await page.title();
|
||||
expect(title).toBe(
|
||||
"source-browsing · Git repository for source browsing tests",
|
||||
);
|
||||
});
|
||||
|
||||
test("page title on project with empty description", async ({
|
||||
page,
|
||||
authenticatedPeer,
|
||||
}) => {
|
||||
const { rid } = await createProject(authenticatedPeer, {
|
||||
name: "ProjectWithNoDescription",
|
||||
});
|
||||
await page.goto(authenticatedPeer.ridUrl(rid), {
|
||||
waitUntil: "networkidle",
|
||||
});
|
||||
const title = await page.title();
|
||||
expect(title).toBe("ProjectWithNoDescription");
|
||||
});
|
||||
|
||||
test("navigate project paths with an explicitly selected peer", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user