Skip to content

Commit

Permalink
add search, filter, watchlist, involved projects view
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Jun 24, 2024
1 parent c32304a commit ea4411b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/new/widget/components/project/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const EditButton = ({ item }) => {
id: item.path,
},
})}
onClick={(e) => e.stopPropagation()}
type="icon"
className={"rounded-3"}
variant="primary"
Expand Down
5 changes: 4 additions & 1 deletion apps/new/widget/page/projects/MainViewContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ const ProjectCardWrapper = ({ children, project }) => {
return (
<div
className="cursor d-flex flex-1"
onClick={() => setShowQuickView(project)}
onClick={(e) => {
e.stopPropagation();
setShowQuickView(project);
}}
>
{children}
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/old/widget/components/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function Button({
className={linkClassName}
style={{ textDecoration: "none" }}
target={target}
onClick={(e) => e.stopPropagation()}
>
<StyledButton
id={id}
Expand All @@ -128,6 +129,7 @@ function Button({
className={linkClassName}
style={{ textDecoration: "none" }}
target={target}
onClick={(e) => e.stopPropagation()}
>
<StyledButton
id={id}
Expand Down
84 changes: 84 additions & 0 deletions playwright-tests/tests/projects.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,88 @@ test.describe("?page=projects", () => {
});
});
});

test.describe("Watchlist", () => {
test.beforeEach(async ({ page }) => {
await page.goto(`/${ROOT_SRC}?page=projects&tab=watchList`);
});

test.describe("User is not logged in", () => {
test.use({
storageState:
"playwright-tests/storage-states/wallet-not-connected.json",
});

test("should see login screen", async ({ page }) => {
const requireLogin = await page.getByText(
"Please log in in order to see watchlist projects!",
);
await expect(requireLogin).toBeVisible();
});
});

test.describe("User is logged in with bookmarked project", () => {
test.use({
storageState:
"playwright-tests/storage-states/wallet-connected-project-owner.json",
});
test("should see projects", async ({ page }) => {
const projectTitle = await page.getByText(
"Testing project on Build DAO",
);
await expect(projectTitle).toBeVisible();
});
});

test.describe("User without bookmarked projects is logged in", () => {
test.use({
storageState: "playwright-tests/storage-states/wallet-connected.json",
});
test("should see empty page", async ({ page }) => {
const noProjectFound = await page.getByText("No Projects Found");
await expect(noProjectFound).toBeVisible();
});
});
});

test.describe("Projects Involved", () => {
test.beforeEach(async ({ page }) => {
await page.goto(`/${ROOT_SRC}?page=projects&tab=involvedProjects`);
});

test.describe("User is not logged in", () => {
test.use({
storageState:
"playwright-tests/storage-states/wallet-not-connected.json",
});
test("should see login screen", async ({ page }) => {
const requireLogin = await page.getByText(
"Please log in in order to see involved projects!",
);
await expect(requireLogin).toBeVisible();
});
});

test.describe("User involved in projects is logged in", () => {
test.use({
storageState: "playwright-tests/storage-states/wallet-connected.json",
});
test("should see project", async ({ page }) => {
const projectTitle = await page.getByText(
"Testing project on Build DAO",
);
await expect(projectTitle).toBeVisible();
});
});

test.describe("User not involved in projects is logged in", () => {
test.use({
storageState: "playwright-tests/storage-states/wallet-connected.json",
});
test("should see empty screen", async ({ page }) => {
const noProjectFound = await page.getByText("No Projects Found");
await expect(noProjectFound).toBeVisible();
});
});
});
});

0 comments on commit ea4411b

Please sign in to comment.