From 72f32ad5db6f0f7ac19126737333763cb9e46a1a Mon Sep 17 00:00:00 2001 From: Spandan Datta Date: Mon, 22 Apr 2024 00:52:03 -0500 Subject: [PATCH 1/5] make sure active pots are being shown on pot page --- apps/potlock/widget/Pots/Card.jsx | 13 +++--- playwright-report/index.html | 68 +++++++++++++++++++++++++++++ playwright-tests/tests/pots.spec.js | 16 ++++++- 3 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 playwright-report/index.html diff --git a/apps/potlock/widget/Pots/Card.jsx b/apps/potlock/widget/Pots/Card.jsx index bbd1a9f..e0d9a8d 100644 --- a/apps/potlock/widget/Pots/Card.jsx +++ b/apps/potlock/widget/Pots/Card.jsx @@ -256,10 +256,12 @@ const Tag = (props) => ( : {}), }} /> -); - -return ( - + ); + + + return ( + {title} @@ -284,4 +286,5 @@ return ( {tags.map((tag) => (tag.visibility ? : ""))} -); + ); + \ No newline at end of file diff --git a/playwright-report/index.html b/playwright-report/index.html new file mode 100644 index 0000000..afaffa6 --- /dev/null +++ b/playwright-report/index.html @@ -0,0 +1,68 @@ + + + + + + + + + Playwright Test Report + + + + +
+ + + \ No newline at end of file diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js index ee9bac1..3c8fd4b 100644 --- a/playwright-tests/tests/pots.spec.js +++ b/playwright-tests/tests/pots.spec.js @@ -53,8 +53,20 @@ test("clicking learn more button should...", async ({ page }) => { }); test("should show active pots", async ({ page }) => { - // TODO: -}); + await page.goto(`${ROOT_SRC}?tab=pots`); + + const activePots = page.locator('[data-testid="active-pot"]'); + + + await activePots.first().waitFor(); + + + const count = await activePots.count(); + for (let i = 0; i < count; i++) { + await expect(activePots.nth(i)).toBeVisible(); + } + }); + test("should show completed pots", async ({ page }) => { // TODO: From a1b46c6cb1881ec4ceac92899a339b15eec8d8d7 Mon Sep 17 00:00:00 2001 From: Spandan Datta Date: Mon, 22 Apr 2024 20:38:50 -0500 Subject: [PATCH 2/5] Formated code with npm run fmt --- apps/potlock/widget/Pots/Card.jsx | 16 ++++++++-------- playwright-tests/tests/pots.spec.js | 13 +++++-------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/potlock/widget/Pots/Card.jsx b/apps/potlock/widget/Pots/Card.jsx index e0d9a8d..2734f30 100644 --- a/apps/potlock/widget/Pots/Card.jsx +++ b/apps/potlock/widget/Pots/Card.jsx @@ -256,12 +256,13 @@ const Tag = (props) => ( : {}), }} /> - ); - - - return ( - +); + +return ( + {title} @@ -286,5 +287,4 @@ const Tag = (props) => ( {tags.map((tag) => (tag.visibility ? : ""))} - ); - \ No newline at end of file +); diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js index 3c8fd4b..fac5849 100644 --- a/playwright-tests/tests/pots.spec.js +++ b/playwright-tests/tests/pots.spec.js @@ -54,19 +54,16 @@ test("clicking learn more button should...", async ({ page }) => { test("should show active pots", async ({ page }) => { await page.goto(`${ROOT_SRC}?tab=pots`); - + const activePots = page.locator('[data-testid="active-pot"]'); - - - await activePots.first().waitFor(); - - + + await activePots.first().waitFor(); + const count = await activePots.count(); for (let i = 0; i < count; i++) { await expect(activePots.nth(i)).toBeVisible(); } - }); - +}); test("should show completed pots", async ({ page }) => { // TODO: From 3d847b0af356f6673904d69f67a9c84391edf747 Mon Sep 17 00:00:00 2001 From: Spandan Datta Date: Fri, 26 Apr 2024 01:34:52 -0500 Subject: [PATCH 3/5] Complete Pot test --- apps/potlock/widget/Pots/Card.jsx | 49 +++++++++++++++-------------- playwright-tests/tests/pots.spec.js | 15 +++++++-- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/apps/potlock/widget/Pots/Card.jsx b/apps/potlock/widget/Pots/Card.jsx index 2734f30..ecb12e2 100644 --- a/apps/potlock/widget/Pots/Card.jsx +++ b/apps/potlock/widget/Pots/Card.jsx @@ -240,29 +240,30 @@ const tags = [ ]; const Tag = (props) => ( - - ), - } - : {}), - }} - /> + + ), + } + : {}), + }} + /> ); + return ( - + {title} @@ -275,8 +276,7 @@ return ( borderTop: "1px #7B7B7B solid", marginTop: "auto", height: "fit-content", - }} - > + }}> <div> {amountNear} @@ -284,7 +284,8 @@ return ( <span className="text">in pot</span> </div> - {tags.map((tag) => (tag.visibility ? : ""))} + {tags.filter(tag => tag.visibility).map(tag => )} -); + ); + \ No newline at end of file diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js index fac5849..cf6804b 100644 --- a/playwright-tests/tests/pots.spec.js +++ b/playwright-tests/tests/pots.spec.js @@ -57,7 +57,7 @@ test("should show active pots", async ({ page }) => { const activePots = page.locator('[data-testid="active-pot"]'); - await activePots.first().waitFor(); + await activePots.first().waitFor({ timeout: 60000 }); const count = await activePots.count(); for (let i = 0; i < count; i++) { @@ -65,8 +65,19 @@ test("should show active pots", async ({ page }) => { } }); + test("should show completed pots", async ({ page }) => { - // TODO: + await page.goto(`${ROOT_SRC}?tab=pots`); + + const completedPots = page.locator('[data-testid="complete-pot"]'); + + await completedPots.first().waitFor({ timeout: 60000 }); + + const count = await activePots.count(); + for (let i = 0; i < count; i++) { + await expect(activePots.nth(i)).toBeVisible(); + } + }); test("should sort pots", async ({ page }) => { From 1b6767aa4bcd065e97e359ca4c913b9c1b3954c6 Mon Sep 17 00:00:00 2001 From: Spandan Datta Date: Mon, 6 May 2024 21:24:40 -0500 Subject: [PATCH 4/5] finshed completed-pot test --- apps/potlock/widget/Pots/Card.jsx | 15 ++++++++------- playwright-tests/tests/pots.spec.js | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/potlock/widget/Pots/Card.jsx b/apps/potlock/widget/Pots/Card.jsx index ecb12e2..d60f7c9 100644 --- a/apps/potlock/widget/Pots/Card.jsx +++ b/apps/potlock/widget/Pots/Card.jsx @@ -260,10 +260,10 @@ const Tag = (props) => ( return ( - + {title} @@ -276,7 +276,8 @@ return ( borderTop: "1px #7B7B7B solid", marginTop: "auto", height: "fit-content", - }}> + }} + > <div> {amountNear} @@ -284,8 +285,8 @@ return ( <span className="text">in pot</span> </div> - {tags.filter(tag => tag.visibility).map(tag => )} + {tags.map((tag) => (tag.visibility ? : ""))} - ); +); \ No newline at end of file diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js index cf6804b..357d134 100644 --- a/playwright-tests/tests/pots.spec.js +++ b/playwright-tests/tests/pots.spec.js @@ -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++) { @@ -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(); } }); From f6919b531ab95acc4becb9ddefa4623b86b777c6 Mon Sep 17 00:00:00 2001 From: Spandan Datta Date: Sun, 12 May 2024 23:14:35 -0500 Subject: [PATCH 5/5] Formatted Completed pot test --- apps/potlock/widget/Pots/Card.jsx | 34 ++++++++++++++--------------- playwright-tests/tests/pots.spec.js | 2 -- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/apps/potlock/widget/Pots/Card.jsx b/apps/potlock/widget/Pots/Card.jsx index d60f7c9..2734f30 100644 --- a/apps/potlock/widget/Pots/Card.jsx +++ b/apps/potlock/widget/Pots/Card.jsx @@ -240,25 +240,24 @@ const tags = [ ]; const Tag = (props) => ( - - ), - } - : {}), - }} - /> + + ), + } + : {}), + }} + /> ); - return ( ); - \ No newline at end of file diff --git a/playwright-tests/tests/pots.spec.js b/playwright-tests/tests/pots.spec.js index 357d134..a55bd48 100644 --- a/playwright-tests/tests/pots.spec.js +++ b/playwright-tests/tests/pots.spec.js @@ -65,7 +65,6 @@ test("should show active pots", async ({ page }) => { } }); - test("should show completed pots", async ({ page }) => { await page.goto(`${ROOT_SRC}?tab=pots`); @@ -77,7 +76,6 @@ test("should show completed pots", async ({ page }) => { for (let i = 0; i < count; i++) { await expect(completedPots.nth(i)).toBeVisible(); } - }); test("should sort pots", async ({ page }) => {