Skip to content

Commit

Permalink
Remove tests relying on rad-web
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinez committed Jun 27, 2024
1 parent 1db8fa6 commit 2f71cef
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 1,123 deletions.
173 changes: 0 additions & 173 deletions http-client/tests/project.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ import { HttpdClient } from "@http-client";
import {
aliceMainHead,
aliceRemote,
bobRemote,
cobRid,
defaultHttpdPort,
sourceBrowsingRid,
} from "@tests/support/fixtures.js";
import {
assertIssue,
assertPatch,
createIssueToBeModified,
createPatchToBeModified,
} from "@http-client/tests/support/support";
import { authenticate } from "@http-client/tests/support/httpd.js";
import { testFixture as testWithAPI } from "@http-client/tests/support/fixtures.js";

describe("project", () => {
const api = new HttpdClient({
Expand Down Expand Up @@ -114,114 +105,6 @@ describe("project", () => {
});
});

testWithAPI(
"#createIssue(id, { title, description, assignees, labels })",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const { id: issueId } = await api.project.createIssue(
cobRid,
{
title: "aaa",
description: "bbb",
assignees: [],
embeds: [],
labels: ["bug", "documentation"],
},
sessionId,
);
await assertIssue(
issueId,
{
title: "aaa",
discussion: [{ body: "bbb" }],
assignees: [],
labels: ["bug", "documentation"],
},
api,
);
},
);

testWithAPI(
"#updateIssue(id, issueId, { type: 'edit' }, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const issueId = await createIssueToBeModified(api, sessionId);
await api.project.updateIssue(
cobRid,
issueId,
{ type: "edit", title: "ccc" },
sessionId,
);
await assertIssue(issueId, { title: "ccc" }, api);
},
);

testWithAPI(
"#updateIssue(id, issueId, { type: 'label' }, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const issueId = await createIssueToBeModified(api, sessionId);
await api.project.updateIssue(
cobRid,
issueId,
{ type: "label", labels: ["bug"] },
sessionId,
);
await assertIssue(issueId, { labels: ["bug"] }, api);
},
);

testWithAPI(
"#updateIssue(id, issueId, { type: 'assign' }, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const issueId = await createIssueToBeModified(api, sessionId);
await api.project.updateIssue(
cobRid,
issueId,
{
type: "assign",
assignees: [bobRemote],
},
sessionId,
);
await assertIssue(
issueId,
{
assignees: [
{
id: "did:key:z6Mkg49NtQR2LyYRDCQFK4w1VVHqhypZSSRo7HsyuN7SV7v5",
alias: "bob",
},
],
},
api,
);
},
);

testWithAPI(
"#updateIssue(id, issueId, { type: 'lifecycle' }, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const issueId = await createIssueToBeModified(api, sessionId);
await api.project.updateIssue(
cobRid,
issueId,
{ type: "lifecycle", state: { status: "closed", reason: "solved" } },
sessionId,
);
await assertIssue(
issueId,
{
state: { status: "closed", reason: "solved" },
},
api,
);
},
);

test("#getPatchById(id, patchId)", async () => {
await api.project.getPatchById(
cobRid,
Expand All @@ -232,60 +115,4 @@ describe("project", () => {
test("#getAllPatches(id)", async () => {
await api.project.getAllPatches(cobRid);
});

testWithAPI(
"#createPatch(id, patchCreate, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const { id: oid } = await api.project.createPatch(
cobRid,
{
title: "ppp",
description: "qqq",
target: "d7dd8cecae16b1108234e09dbdb5d64ae394bc25",
oid: "38c225e2a0b47ba59def211f4e4825c31d9463ec",
labels: [],
},
sessionId,
);
await assertPatch(
oid,
{
title: "ppp",
state: { status: "open" },
target: "delegates",
labels: [],
revisions: [
{
description: "qqq",
base: "d7dd8cecae16b1108234e09dbdb5d64ae394bc25",
oid: "38c225e2a0b47ba59def211f4e4825c31d9463ec",
},
],
},
api,
);
},
);

testWithAPI(
"#updatePatch(id, patchId, { type: 'edit' }, authToken)",
async ({ httpd: { api, peer } }) => {
const sessionId = await authenticate(api, peer);
const patchId = await createPatchToBeModified(api, sessionId);
await api.project.updatePatch(
cobRid,
patchId,
{ type: "label", labels: ["bug"] },
sessionId,
);
await assertPatch(
patchId,
{
labels: ["bug"],
},
api,
);
},
);
});
38 changes: 0 additions & 38 deletions http-client/tests/session.test.ts

This file was deleted.

30 changes: 0 additions & 30 deletions http-client/tests/support/httpd.ts

This file was deleted.

31 changes: 0 additions & 31 deletions http-client/tests/support/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,6 @@ import isMatch from "lodash/isMatch";

import { cobRid } from "@tests/support/fixtures";

export async function createIssueToBeModified(
api: HttpdClient,
sessionId: string,
) {
const { id } = await api.project.createIssue(
cobRid,
{ title: "aaa", description: "bbb", embeds: [], assignees: [], labels: [] },
sessionId,
);

return id;
}

export async function createPatchToBeModified(
api: HttpdClient,
sessionId: string,
) {
const { id } = await api.project.createPatch(
cobRid,
{
title: "rrr",
description: "ttt",
target: "d7dd8cecae16b1108234e09dbdb5d64ae394bc25",
oid: "38c225e2a0b47ba59def211f4e4825c31d9463ec",
labels: [],
},
sessionId,
);

return id;
}
export async function assertIssue(
oid: string,
change: Record<string, unknown>,
Expand Down
15 changes: 0 additions & 15 deletions tests/e2e/node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { expect, shortNodeRemote, test } from "@tests/support/fixtures.js";
import { createProject } from "@tests/support/project";

test("node metadata", async ({ page, peerManager }) => {
const peer = await peerManager.createPeer({
Expand Down Expand Up @@ -35,17 +34,3 @@ test("node projects", async ({ page }) => {
).toBeVisible();
}
});

test("seeding projects", async ({ page, authenticatedPeer }) => {
const { rid } = await createProject(authenticatedPeer, {
name: "seedProject",
});

await page.goto(authenticatedPeer.ridUrl(rid));
await page.getByRole("button", { name: "Seeding" }).click();
await page.getByRole("button", { name: "Stop seeding" }).click();
await expect(page.getByRole("button", { name: "Seed 1" })).toBeVisible();

await page.getByRole("button", { name: "Seed 1" }).click();
await expect(page.getByRole("button", { name: "Seeding" })).toBeVisible();
});
70 changes: 0 additions & 70 deletions tests/e2e/project/assignees.spec.ts

This file was deleted.

Loading

0 comments on commit 2f71cef

Please sign in to comment.