Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
fix

update queries, ids, etc..

updating types

load program name

update app card

some more updates

wio

fix

fix

fix

cleanup

ix rounds

lint/clean up - tests wip

owner check/comment out

fix

fixes

some cleanup

cleanup

updated lock

set autoInstallPeers to true
  • Loading branch information
thelostone-mc authored and 0xKurt committed Feb 5, 2024
1 parent c199d13 commit 0b388fd
Show file tree
Hide file tree
Showing 33 changed files with 541 additions and 611 deletions.
132 changes: 89 additions & 43 deletions packages/builder/src/__tests__/reducers/projects.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import "@testing-library/jest-dom";
import { ApplicationStatus, RoundVisibilityType } from "data-layer";
import {
AppStatus,
projectsReducer,
ProjectsState,
Status,
initialState as initialProjectsState,
projectsReducer,
} from "../../reducers/projects";
import { addressFrom } from "../../utils/test_utils";

Expand All @@ -21,18 +21,64 @@ describe("projects reducer", () => {
applications: {
"1": [
{
roundID: addressFrom(1),
status: "PENDING" as AppStatus,
inReview: false,
id: "1",
chainId: 1,
roundId: addressFrom(1),
status: "PENDING" as ApplicationStatus,
metadataCid: "0x1",
metadata: {},
inReview: false,
round: {
applicationsStartTime: "0",
applicationsEndTime: "0",
donationsStartTime: "0",
donationsEndTime: "0",
roundMetadata: {
name: "Round 1",
roundType: "public" as RoundVisibilityType,
eligibility: {
description: "Eligibility description",
requirements: [{ requirement: "Requirement 1" }],
},
programContractAddress: "0x1",
support: {
info: "https://support.com",
type: "WEBSITE",
},
},
name: "Round 1",
},
},
],
"2": [
{
roundID: addressFrom(2),
status: "PENDING" as AppStatus,
inReview: false,
id: "1",
chainId: 1,
roundId: addressFrom(2),
status: "PENDING" as ApplicationStatus,
metadataCid: "0x1",
metadata: {},
inReview: false,
round: {
applicationsStartTime: "0",
applicationsEndTime: "0",
donationsStartTime: "0",
donationsEndTime: "0",
roundMetadata: {
name: "Round 2",
roundType: "public" as RoundVisibilityType,
eligibility: {
description: "Eligibility description",
requirements: [{ requirement: "Requirement 1" }],
},
programContractAddress: "0x1",
support: {
info: "https://support.com",
type: "WEBSITE",
},
},
name: "Round 2",
},
},
],
},
Expand All @@ -46,8 +92,8 @@ describe("projects reducer", () => {
expect(newState.applications).toEqual({
"1": [
{
roundID: addressFrom(1),
status: "PENDING",
roundId: addressFrom(1),
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand All @@ -61,8 +107,8 @@ describe("projects reducer", () => {
applications: {
"1": [
{
roundID: addressFrom(1),
status: "PENDING" as AppStatus,
roundId: addressFrom(1),
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand All @@ -75,8 +121,8 @@ describe("projects reducer", () => {
projectID: "2",
applications: [
{
roundID: addressFrom(2),
status: "APPROVED",
roundId: addressFrom(2),
status: "APPROVED" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand All @@ -86,16 +132,16 @@ describe("projects reducer", () => {
expect(newState.applications).toEqual({
"1": [
{
roundID: addressFrom(1),
status: "PENDING",
roundId: addressFrom(1),
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
],
"2": [
{
roundID: addressFrom(2),
status: "APPROVED",
roundId: addressFrom(2),
status: "APPROVED" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand All @@ -119,42 +165,42 @@ describe("projects reducer", () => {
applications: {
"1": [
{
roundID: "0x1",
status: "PENDING" as AppStatus,
roundId: "0x1",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
],
"2": [
{
roundID: "0x1",
status: "PENDING" as AppStatus,
roundId: "0x1",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x2",
status: "PENDING" as AppStatus,
roundId: "0x2",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x3",
status: "PENDING" as AppStatus,
roundId: "0x3",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x4",
status: "PENDING" as AppStatus,
roundId: "0x4",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
],
"3": [
{
roundID: "0x3",
status: "PENDING" as AppStatus,
roundId: "0x3",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand All @@ -165,49 +211,49 @@ describe("projects reducer", () => {
const newState: ProjectsState = projectsReducer(initialState, {
type: "PROJECT_APPLICATION_UPDATED",
projectID: "2",
roundID: "0x3",
roundId: "0x3",
status: "APPROVED",
});

expect(newState.applications).toEqual({
"1": [
{
roundID: "0x1",
status: "PENDING" as AppStatus,
roundId: "0x1",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
],
"2": [
{
roundID: "0x1",
status: "PENDING" as AppStatus,
roundId: "0x1",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x2",
status: "PENDING" as AppStatus,
roundId: "0x2",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x3",
status: "APPROVED" as AppStatus,
roundId: "0x3",
status: "APPROVED" as ApplicationStatus,
inReview: false,
chainId: 1,
},
{
roundID: "0x4",
status: "PENDING" as AppStatus,
roundId: "0x4",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
],
"3": [
{
roundID: "0x3",
status: "PENDING" as AppStatus,
roundId: "0x3",
status: "PENDING" as ApplicationStatus,
inReview: false,
chainId: 1,
},
Expand Down
Loading

0 comments on commit 0b388fd

Please sign in to comment.