Skip to content

Commit

Permalink
finshed completed-pot test
Browse files Browse the repository at this point in the history
  • Loading branch information
Spandan Datta authored and Spandan Datta committed May 7, 2024
1 parent 3d847b0 commit 1b6767a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
15 changes: 8 additions & 7 deletions apps/potlock/widget/Pots/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ const Tag = (props) => (


return (
<Card href={props.hrefWithParams(`?tab=pot&potId=${potId}`)}
data-testid={
(applicationOpen ? "active-pot" : "inactive-pot") +
(payoutsCompleted ? "complete-pot" : "incomplete-pot")}>
<Card
href={props.hrefWithParams(`?tab=pot&potId=${potId}`)}
data-testid={applicationOpen ? "active-pot" : "inactive-pot"}
>
<CardSection>
<Title>{title}</Title>
<Description>
Expand All @@ -276,16 +276,17 @@ return (
borderTop: "1px #7B7B7B solid",
marginTop: "auto",
height: "fit-content",
}}>
}}
>
<Title>
<div>
{amountNear}
{amountUsd && <span className="usd-amount">{amountUsd}</span>}
<span className="text">in pot</span>
</div>
</Title>
{tags.filter(tag => tag.visibility).map(tag => <Tag {...tag} key={tag.text} />)}
{tags.map((tag) => (tag.visibility ? <Tag {...tag} key={tag.text} /> : ""))}
</CardSection>
</Card>
);
);

10 changes: 5 additions & 5 deletions playwright-tests/tests/pots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test("should show active pots", async ({ page }) => {

const activePots = page.locator('[data-testid="active-pot"]');

await activePots.first().waitFor({ timeout: 60000 });
await activePots.first().waitFor();

const count = await activePots.count();
for (let i = 0; i < count; i++) {
Expand All @@ -69,13 +69,13 @@ test("should show active pots", async ({ page }) => {
test("should show completed pots", async ({ page }) => {
await page.goto(`${ROOT_SRC}?tab=pots`);

const completedPots = page.locator('[data-testid="complete-pot"]');
const completedPots = page.locator('[data-testid="inactive-pot"]');

await completedPots.first().waitFor({ timeout: 60000 });
await completedPots.first().waitFor();

const count = await activePots.count();
const count = await completedPots.count();
for (let i = 0; i < count; i++) {
await expect(activePots.nth(i)).toBeVisible();
await expect(completedPots.nth(i)).toBeVisible();
}

});
Expand Down

0 comments on commit 1b6767a

Please sign in to comment.