Skip to content

Commit 0fe75f2

Browse files
committed
fix(desktop): stabilize project review smoke coverage
Give avatar-only authors accessible names, align project smoke expectations with the redesigned context UI, and remove unrelated or unused branch riders that blocked CI. Signed-off-by: Thomas Petersen <[email protected]>
1 parent 2a49438 commit 0fe75f2

5 files changed

Lines changed: 52 additions & 59 deletions

File tree

‎.github/workflows/docker.yml‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,7 @@ jobs:
377377
[worker.oci]
378378
max-parallelism = 2
379379
- name: Log in to GHCR
380-
id: ghcr-login
381380
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
382-
continue-on-error: true
383-
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
384-
with:
385-
registry: ghcr.io
386-
username: ${{ github.repository_owner }}
387-
password: ${{ secrets.GITHUB_TOKEN }}
388-
- name: Retry GHCR login
389-
if: steps.ghcr-login.outcome == 'failure'
390381
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
391382
with:
392383
registry: ghcr.io

‎crates/buzz-cli/src/links.rs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ pub fn repo_link(owner: &str, repo_id: &str) -> String {
3838
format!("buzz://repo?owner={owner}&d={repo_id}")
3939
}
4040

41-
/// Build a link to a specific git commit in a repository.
42-
pub fn commit_link(commit_hash: &str, owner: &str, repo_id: &str) -> String {
43-
format!("buzz://repo?owner={owner}&d={repo_id}&tab=commits&commit={commit_hash}")
44-
}
45-
4641
/// Build a `buzz://project` link for a project announcement (kind 30621).
4742
pub fn project_link(owner: &str, project_id: &str) -> String {
4843
format!("buzz://project?owner={owner}&d={project_id}")
@@ -90,10 +85,6 @@ mod tests {
9085
project_link(owner, dtag),
9186
golden["links"]["project"].as_str().unwrap()
9287
);
93-
assert_eq!(
94-
commit_link(event_id, owner, dtag),
95-
golden["links"]["commit"].as_str().unwrap()
96-
);
9788
}
9889

9990
#[test]

‎desktop/src/features/projects/ui/ProjectProfileIdentity.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export function ProfileIdentityButton({
7979

8080
return (
8181
<UserProfilePopover pubkey={pubkey} triggerElement="span">
82-
<button className={className} type="button">
82+
<button
83+
aria-label={showLabel ? undefined : label}
84+
className={className}
85+
type="button"
86+
>
8387
{inner}
8488
</button>
8589
</UserProfilePopover>

‎desktop/tests/e2e/project-inbox.spec.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ test("Buzz Git pull request renders and stays actionable in Inbox", async ({
3131

3232
const alicePullRequest = page
3333
.getByTestId("project-pull-request-row")
34-
.filter({ hasText: "alice" })
34+
.filter({
35+
has: page.getByRole("button", { name: "alice", exact: true }),
36+
})
3537
.first();
3638
await expect(alicePullRequest).toBeVisible({ timeout: 10_000 });
3739
const pullRequestId = await alicePullRequest.getAttribute(

‎desktop/tests/e2e/project-pr-review.spec.ts‎

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ async function addProjectToSidebar(
4343
await browser.getByTestId(`project-browser-result-${dtag}`).click();
4444
}
4545

46+
function pullRequestRowByAuthor(
47+
page: import("@playwright/test").Page,
48+
author: string,
49+
) {
50+
return page.getByTestId("project-pull-request-row").filter({
51+
has: page.getByRole("button", { name: author, exact: true }),
52+
});
53+
}
54+
55+
async function expectLocalRepositoryOpenAction(
56+
page: import("@playwright/test").Page,
57+
) {
58+
const openButton = page.getByRole("button", { name: "Open", exact: true });
59+
await expect(openButton).toHaveAttribute(
60+
"title",
61+
"Open local repository folder",
62+
);
63+
await expect(
64+
page.getByRole("link", { name: "Open", exact: true }),
65+
).toHaveCount(0);
66+
}
67+
4668
test("same-second request changes supersedes approval", async ({ page }) => {
4769
await enableProjectsFeature(page);
4870
await page.addInitScript(() => {
@@ -52,10 +74,7 @@ test("same-second request changes supersedes approval", async ({ page }) => {
5274
await openBuzzProject(page);
5375

5476
await page.getByRole("tab", { name: "Review" }).click();
55-
const aliceRow = page
56-
.getByTestId("project-pull-request-row")
57-
.filter({ hasText: "alice" })
58-
.first();
77+
const aliceRow = pullRequestRowByAuthor(page, "alice").first();
5978
await expect(aliceRow).toBeVisible({ timeout: 10_000 });
6079
await aliceRow.getByRole("button", { name: /^#/ }).click();
6180

@@ -123,15 +142,16 @@ test("PR creator/owner can toggle draft, request reviews, and approve", async ({
123142

124143
// Pick a PR authored by alice: the viewer is not the author, so the
125144
// Approve button must be available alongside the owner status controls.
126-
const aliceRow = prRows.filter({ hasText: "alice" }).first();
145+
const aliceRow = prRows
146+
.filter({
147+
has: page.getByRole("button", { name: "alice", exact: true }),
148+
})
149+
.first();
127150
await expect(aliceRow).toBeVisible();
128151
await aliceRow.getByRole("button", { name: /^#/ }).click();
129152

130153
const header = page.getByRole("heading", { level: 3 });
131154
await expect(header.first()).toBeVisible();
132-
await expect(
133-
page.getByRole("heading", { name: "Review", exact: true }),
134-
).toBeVisible();
135155
await expect(page.getByTestId("project-review-summary")).toBeVisible();
136156
const sourceChannelLink = page.getByRole("button", {
137157
name: "Open author-claimed origin channel #general",
@@ -487,10 +507,7 @@ test("merge conflicts offer persistent terminal recovery", async ({ page }) => {
487507
});
488508

489509
await page.getByRole("tab", { name: "Review" }).click();
490-
const aliceRow = page
491-
.getByTestId("project-pull-request-row")
492-
.filter({ hasText: "alice" })
493-
.first();
510+
const aliceRow = pullRequestRowByAuthor(page, "alice").first();
494511
await aliceRow.getByRole("button", { name: /^#/ }).click();
495512
await page.getByRole("button", { name: "Merge", exact: true }).click();
496513
await page.getByTestId("merge-pull-request-confirm-button").click();
@@ -550,10 +567,7 @@ test("reviewer can leave a commit-scoped inline diff comment", async ({
550567
await openBuzzProject(page);
551568

552569
await page.getByRole("tab", { name: "Review" }).click();
553-
const aliceRow = page
554-
.getByTestId("project-pull-request-row")
555-
.filter({ hasText: "alice" })
556-
.first();
570+
const aliceRow = pullRequestRowByAuthor(page, "alice").first();
557571
await aliceRow.getByRole("button", { name: /^#/ }).click();
558572
await page.getByRole("button", { name: /^Files changed/ }).click();
559573

@@ -600,12 +614,12 @@ test("reviewer can leave a commit-scoped inline diff comment", async ({
600614
"Please add a type for this parameter.",
601615
);
602616

603-
await expect(
604-
page.getByText("Please add a type for this parameter."),
605-
).toBeVisible();
606-
await expect(
607-
page.getByText("desktop/src/features/projects/ui/ProjectDetailScreen.tsx"),
608-
).toBeVisible();
617+
const timelineComment = page
618+
.getByTestId("project-pull-request-timeline-row")
619+
.filter({ hasText: "Please add a type for this parameter." });
620+
await expect(timelineComment).toContainText(
621+
"desktop/src/features/projects/ui/ProjectDetailScreen.tsx",
622+
);
609623
await waitForAnimations(page);
610624
await page.screenshot({
611625
fullPage: false,
@@ -652,10 +666,7 @@ test("managed agent repository owner can merge", async ({ page }) => {
652666
await openBuzzProject(page);
653667

654668
await page.getByRole("tab", { name: "Review" }).click();
655-
const agentRow = page
656-
.getByTestId("project-pull-request-row")
657-
.filter({ hasText: "Brain" })
658-
.first();
669+
const agentRow = pullRequestRowByAuthor(page, "Brain").first();
659670
await expect(agentRow).toBeVisible({ timeout: 10_000 });
660671
await agentRow.getByRole("button", { name: /^#/ }).click();
661672
await page.getByRole("button", { name: "Add Reviewer", exact: true }).click();
@@ -1361,9 +1372,7 @@ test("external repositories stay on local source after a branch round trip", asy
13611372
await expect(
13621373
page.getByRole("button", { name: "Local", exact: true }),
13631374
).toBeVisible();
1364-
await expect(
1365-
page.getByRole("link", { name: "Open", exact: true }),
1366-
).toHaveAttribute("href", "https://github.com/block/relay-tools/tree/main");
1375+
await expectLocalRepositoryOpenAction(page);
13671376

13681377
await page.getByRole("button", { name: /main/ }).click();
13691378
await page
@@ -1394,12 +1403,7 @@ test("external repositories stay on local source after a branch round trip", asy
13941403
await expect(
13951404
page.getByRole("button", { name: "Local", exact: true }),
13961405
).toBeVisible();
1397-
await expect(
1398-
page.getByRole("link", { name: "Open", exact: true }),
1399-
).toHaveAttribute(
1400-
"href",
1401-
"https://github.com/block/relay-tools/tree/wintermute%2Fentity-link-recipient-cards-with-a-long-branch-name",
1402-
);
1406+
await expectLocalRepositoryOpenAction(page);
14031407

14041408
await branchTrigger.click();
14051409
await page.getByRole("menuitemradio", { name: "main" }).click();
@@ -1411,9 +1415,7 @@ test("external repositories stay on local source after a branch round trip", asy
14111415
await expect(
14121416
page.getByRole("heading", { name: "Local branch README" }),
14131417
).toBeVisible();
1414-
await expect(
1415-
page.getByRole("link", { name: "Open", exact: true }),
1416-
).toHaveAttribute("href", "https://github.com/block/relay-tools/tree/main");
1418+
await expectLocalRepositoryOpenAction(page);
14171419
await expect(page.getByText("Code hosted on github.com")).toHaveCount(0);
14181420
});
14191421

@@ -1501,7 +1503,10 @@ test("project task can be created with a category from the tasks header", async
15011503
await openBuzzProject(page);
15021504

15031505
await page.getByRole("tab", { name: "Tasks", exact: true }).click();
1504-
await page.getByRole("button", { name: "Create task" }).click();
1506+
await page
1507+
.getByTestId("project-section-header")
1508+
.getByRole("button", { name: "Create task" })
1509+
.click();
15051510
await page
15061511
.getByTestId("create-issue-category")
15071512
.selectOption("change-request");

0 commit comments

Comments
 (0)