Skip to content

Commit ea4411b

Browse files
committed
add search, filter, watchlist, involved projects view
1 parent c32304a commit ea4411b

File tree

4 files changed

+91
-1
lines changed

4 files changed

+91
-1
lines changed

apps/new/widget/components/project/Card.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ const EditButton = ({ item }) => {
116116
id: item.path,
117117
},
118118
})}
119+
onClick={(e) => e.stopPropagation()}
119120
type="icon"
120121
className={"rounded-3"}
121122
variant="primary"

apps/new/widget/page/projects/MainViewContainer.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ const ProjectCardWrapper = ({ children, project }) => {
9393
return (
9494
<div
9595
className="cursor d-flex flex-1"
96-
onClick={() => setShowQuickView(project)}
96+
onClick={(e) => {
97+
e.stopPropagation();
98+
setShowQuickView(project);
99+
}}
97100
>
98101
{children}
99102
</div>

apps/old/widget/components/Button.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function Button({
103103
className={linkClassName}
104104
style={{ textDecoration: "none" }}
105105
target={target}
106+
onClick={(e) => e.stopPropagation()}
106107
>
107108
<StyledButton
108109
id={id}
@@ -128,6 +129,7 @@ function Button({
128129
className={linkClassName}
129130
style={{ textDecoration: "none" }}
130131
target={target}
132+
onClick={(e) => e.stopPropagation()}
131133
>
132134
<StyledButton
133135
id={id}

playwright-tests/tests/projects.spec.js

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,88 @@ test.describe("?page=projects", () => {
222222
});
223223
});
224224
});
225+
226+
test.describe("Watchlist", () => {
227+
test.beforeEach(async ({ page }) => {
228+
await page.goto(`/${ROOT_SRC}?page=projects&tab=watchList`);
229+
});
230+
231+
test.describe("User is not logged in", () => {
232+
test.use({
233+
storageState:
234+
"playwright-tests/storage-states/wallet-not-connected.json",
235+
});
236+
237+
test("should see login screen", async ({ page }) => {
238+
const requireLogin = await page.getByText(
239+
"Please log in in order to see watchlist projects!",
240+
);
241+
await expect(requireLogin).toBeVisible();
242+
});
243+
});
244+
245+
test.describe("User is logged in with bookmarked project", () => {
246+
test.use({
247+
storageState:
248+
"playwright-tests/storage-states/wallet-connected-project-owner.json",
249+
});
250+
test("should see projects", async ({ page }) => {
251+
const projectTitle = await page.getByText(
252+
"Testing project on Build DAO",
253+
);
254+
await expect(projectTitle).toBeVisible();
255+
});
256+
});
257+
258+
test.describe("User without bookmarked projects is logged in", () => {
259+
test.use({
260+
storageState: "playwright-tests/storage-states/wallet-connected.json",
261+
});
262+
test("should see empty page", async ({ page }) => {
263+
const noProjectFound = await page.getByText("No Projects Found");
264+
await expect(noProjectFound).toBeVisible();
265+
});
266+
});
267+
});
268+
269+
test.describe("Projects Involved", () => {
270+
test.beforeEach(async ({ page }) => {
271+
await page.goto(`/${ROOT_SRC}?page=projects&tab=involvedProjects`);
272+
});
273+
274+
test.describe("User is not logged in", () => {
275+
test.use({
276+
storageState:
277+
"playwright-tests/storage-states/wallet-not-connected.json",
278+
});
279+
test("should see login screen", async ({ page }) => {
280+
const requireLogin = await page.getByText(
281+
"Please log in in order to see involved projects!",
282+
);
283+
await expect(requireLogin).toBeVisible();
284+
});
285+
});
286+
287+
test.describe("User involved in projects is logged in", () => {
288+
test.use({
289+
storageState: "playwright-tests/storage-states/wallet-connected.json",
290+
});
291+
test("should see project", async ({ page }) => {
292+
const projectTitle = await page.getByText(
293+
"Testing project on Build DAO",
294+
);
295+
await expect(projectTitle).toBeVisible();
296+
});
297+
});
298+
299+
test.describe("User not involved in projects is logged in", () => {
300+
test.use({
301+
storageState: "playwright-tests/storage-states/wallet-connected.json",
302+
});
303+
test("should see empty screen", async ({ page }) => {
304+
const noProjectFound = await page.getByText("No Projects Found");
305+
await expect(noProjectFound).toBeVisible();
306+
});
307+
});
308+
});
225309
});

0 commit comments

Comments
 (0)