Skip to content

Commit

Permalink
Merge branch 'PotLock:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
saadiqbal-dev authored Apr 25, 2024
2 parents 049ab39 + b5892cb commit ea778fa
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apps/potlock/widget/Pots/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ const Tag = (props) => (
);

return (
<Card href={props.hrefWithParams(`?tab=pot&potId=${potId}`)}>
<Card
href={props.hrefWithParams(`?tab=pot&potId=${potId}`)}
data-testid={applicationOpen ? "active-pot" : "inactive-pot"}
>
<CardSection>
<Title>{title}</Title>
<Description>
Expand Down
4 changes: 3 additions & 1 deletion apps/potlock/widget/Pots/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ const applicationExists = existingApplication || applicationSuccess;

const now = Date.now();
const publicRoundOpen = now >= public_round_start_ms && now < public_round_end_ms;
const publicRoundEnded = now > public_round_end_ms;

const applicationOpen = now >= application_start_ms && now < application_end_ms;

const canApply = applicationOpen && !applicationExists && !userIsChefOrGreater;

const canPayoutsBeSet = userIsChefOrGreater && !cooldown_end_ms && !all_paid_out;
const canPayoutsBeSet = userIsChefOrGreater && !all_paid_out && publicRoundEnded;

const canPayoutsBeProcessed = userIsAdminOrGreater && now >= cooldown_end_ms && !all_paid_out;

Expand Down Expand Up @@ -155,6 +156,7 @@ const Fund = styled.div`
`;
const ButtonsWrapper = styled.div`
display: flex;
flex-wrap: wrap;
gap: 2rem;
a,
button {
Expand Down
2 changes: 1 addition & 1 deletion apps/potlock/widget/Project/ListPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ const [projects, approvedProjects] = useMemo(() => {
return [allRegistrations, approvedProjects];
}, allRegistrations);

const featuredProjectIds = ["magicbuild.near", "potlock.near", "yearofchef.near"];
const featuredProjectIds = ["v1.foodbank.near", "potlock.near", "yearofchef.near"];
const featuredProjects = useMemo(
() => projects.filter((project) => featuredProjectIds.includes(project.registrant_id)),
projects
Expand Down
68 changes: 68 additions & 0 deletions playwright-report/index.html

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion playwright-tests/tests/pots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ 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 }) => {
Expand Down

0 comments on commit ea778fa

Please sign in to comment.