mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 16:50:47 +08:00
The update resulted in changes to all issue and patch IDs. We adapt the tests so that they do not rely on fixed IDs. Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
73 lines
2.0 KiB
TypeScript
73 lines
2.0 KiB
TypeScript
import { test } from "@tests/support/fixtures.js";
|
|
import {
|
|
createProject,
|
|
expectReactionsToWork,
|
|
expectThreadCommentingToWork,
|
|
extractPatchId,
|
|
} from "@tests/support/project";
|
|
|
|
test("leave comments and replies", async ({ page, authenticatedPeer }) => {
|
|
const { rid, projectFolder } = await createProject(
|
|
authenticatedPeer,
|
|
"commenting",
|
|
);
|
|
await authenticatedPeer.rad(
|
|
[
|
|
"issue",
|
|
"open",
|
|
"--title",
|
|
"This is an issue to write comments and replies",
|
|
"--description",
|
|
"We'll give it a few comments and replies.",
|
|
],
|
|
{ cwd: projectFolder },
|
|
);
|
|
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/issues`);
|
|
await page
|
|
.getByRole("link", {
|
|
name: "This is an issue to write comments and replies",
|
|
})
|
|
.click();
|
|
await expectThreadCommentingToWork(page);
|
|
|
|
await authenticatedPeer.git(["switch", "-c", "feature-1"], {
|
|
cwd: projectFolder,
|
|
});
|
|
await authenticatedPeer.git(
|
|
["commit", "--allow-empty", "-m", "Some patch title"],
|
|
{
|
|
cwd: projectFolder,
|
|
},
|
|
);
|
|
const patchId = extractPatchId(
|
|
await authenticatedPeer.git(["push", "rad", "HEAD:refs/patches"], {
|
|
cwd: projectFolder,
|
|
}),
|
|
);
|
|
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/patches/${patchId}`);
|
|
await expectThreadCommentingToWork(page);
|
|
});
|
|
|
|
test("add and remove reactions", async ({ page, authenticatedPeer }) => {
|
|
const { rid, projectFolder } = await createProject(
|
|
authenticatedPeer,
|
|
"reactions",
|
|
);
|
|
await authenticatedPeer.git(["switch", "-c", "feature-1"], {
|
|
cwd: projectFolder,
|
|
});
|
|
await authenticatedPeer.git(
|
|
["commit", "--allow-empty", "-m", "Some patch title"],
|
|
{
|
|
cwd: projectFolder,
|
|
},
|
|
);
|
|
const patchId = extractPatchId(
|
|
await authenticatedPeer.git(["push", "rad", "HEAD:refs/patches"], {
|
|
cwd: projectFolder,
|
|
}),
|
|
);
|
|
await page.goto(`${authenticatedPeer.uiUrl()}/${rid}/patches/${patchId}`);
|
|
await expectReactionsToWork(page);
|
|
});
|