Skip to content

Commit

Permalink
Add visual test for outdated reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez authored and Minion3665 committed Oct 12, 2024
1 parent 144fc42 commit 9586853
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 24 additions & 3 deletions tests/support/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,24 @@ export async function createSourceBrowsingFixture(
await bob.stopNode();
}

export async function createCobsFixture(peer: RadiclePeer) {
export async function createCobsFixture(
peerManager: PeerManager,
peer: RadiclePeer,
) {
await peer.rad(["follow", peer.nodeId, "--alias", "palm"]);
await Fs.mkdir(Path.join(tmpDir, "repos", "cobs"));
const { repoFolder, defaultBranch } = await createRepo(peer, {
const { repoFolder, rid, defaultBranch } = await createRepo(peer, {
name: "cobs",
});
const eve = await peerManager.createPeer({
name: "eve",
gitOptions: gitOptions["eve"],
});
await eve.startNode({
node: { ...defaultConfig.node, connect: [peer.address], alias: "eve" },
});
await eve.rad(["clone", rid], { cwd: eve.checkoutPath });

const issueOne = await issue.create(
peer,
"This `title` has **markdown**",
Expand Down Expand Up @@ -474,7 +486,7 @@ export async function createCobsFixture(peer: RadiclePeer) {
["patch", "label", patchThree, "--add", "documentation"],
createOptions(repoFolder, 1),
);
await peer.rad(
await eve.rad(
["patch", "review", patchThree, "-m", "This looks better"],
createOptions(repoFolder, 2),
);
Expand Down Expand Up @@ -612,6 +624,15 @@ export const gitOptions = {
GIT_COMMITTER_EMAIL: "bob@radicle.xyz",
GIT_COMMITTER_DATE: "1671627600",
},

eve: {
GIT_AUTHOR_NAME: "Eve Johnson",
GIT_AUTHOR_EMAIL: "eve@radicle.xyz",
GIT_AUTHOR_DATE: "1671125284",
GIT_COMMITTER_NAME: "Eve Johnson",
GIT_COMMITTER_EMAIL: "eve@radicle.xyz",
GIT_COMMITTER_DATE: "1671627600",
},
};
export const defaultConfig: Config = {
publicExplorer: "https://app.radicle.xyz/nodes/$host/$rid$path",
Expand Down
2 changes: 1 addition & 1 deletion tests/support/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default async function globalSetup(): Promise<() => void> {
console.log("Creating markdown fixture");
await createMarkdownFixture(palm);
console.log("Creating cobs fixture");
await createCobsFixture(palm);
await createCobsFixture(peerManager, palm);
console.log("All fixtures created");
} catch (error) {
console.log("");
Expand Down

0 comments on commit 9586853

Please sign in to comment.