@@ -243,3 +240,71 @@ export default function ViewRoundPage() {
>
);
}
+
+type ViewGrantsExplorerButtonType = {
+ styles?: string;
+ iconStyle?: string;
+ chainId: string;
+ roundId: string | undefined;
+};
+
+function RoundName(props: { round?: Round }) {
+ return (
+
+ {props.round?.roundMetadata?.name || "Round Details"}
+
+ );
+}
+
+export function ViewGrantsExplorerButton(props: ViewGrantsExplorerButtonType) {
+ const { chainId, roundId } = props;
+
+ return (
+
+ );
+}
+
+function redirectToGrantExplorer(chainId: string, roundId: string | undefined) {
+ const url = `${process.env.REACT_APP_GRANT_EXPLORER}/#/round/${chainId}/${roundId}`;
+ setTimeout(() => {
+ window.open(url, "_blank", "noopener,noreferrer");
+ }, 1000);
+}
+
+function ApplicationOpenDateRange(props: { startTime: any; endTime: any }) {
+ return (
+
+
+
Applications:
+
+ {props.startTime || "..."}
+ -
+ {props.endTime || "..."}
+
+
+ );
+}
+
+function RoundOpenDateRange(props: { startTime: any; endTime: any }) {
+ return (
+
+
+
Round:
+
+ {props.startTime || "..."}
+ -
+ {props.endTime || "..."}
+
+
+ );
+}
diff --git a/packages/round-manager/src/features/round/__tests__/ApplicationsApproved.test.tsx b/packages/round-manager/src/features/round/__tests__/ApplicationsApproved.test.tsx
index 964faeecd9..93fb2530b5 100644
--- a/packages/round-manager/src/features/round/__tests__/ApplicationsApproved.test.tsx
+++ b/packages/round-manager/src/features/round/__tests__/ApplicationsApproved.test.tsx
@@ -393,11 +393,8 @@ export const renderWithContext = (
{
applicationIdOverride,
projectTwitterOverride: expectedTwitterHandle,
});
- grantApplicationWithNoVc.project.credentials = {};
+
+ grantApplicationWithNoVc.project!.credentials = {};
(getApplicationById as any).mockResolvedValue(grantApplicationWithNoVc);
renderWithContext(, {
@@ -260,7 +261,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectGithubOverride: expectedGithubOrganizationName,
});
- grantApplicationWithNoVc.project.credentials = {};
+ grantApplicationWithNoVc.project!.credentials = {};
(getApplicationById as any).mockResolvedValue(grantApplicationWithNoVc);
renderWithContext(, {
@@ -311,7 +312,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectTwitterOverride: handle.toLowerCase(),
});
- grantApplication.project.projectTwitter = handle.toUpperCase();
+ grantApplication.project!.projectTwitter = handle.toUpperCase();
(getApplicationById as any).mockResolvedValue(grantApplication);
renderWithContext(, {
@@ -336,7 +337,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectGithubOverride: handle.toLowerCase(),
});
- grantApplication.project.projectGithub = handle.toUpperCase();
+ grantApplication.project!.projectGithub = handle.toUpperCase();
(getApplicationById as any).mockResolvedValue(grantApplication);
renderWithContext(, {
@@ -411,7 +412,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectGithubOverride: "whatever",
});
- grantApplication.project.credentials["github"].issuer = fakeIssuer;
+ grantApplication.project!.credentials["github"].issuer = fakeIssuer;
(getApplicationById as any).mockResolvedValue(grantApplication);
renderWithContext(, {
@@ -436,7 +437,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectTwitterOverride: handle,
});
- grantApplication.project.projectTwitter = "not some handle";
+ grantApplication.project!.projectTwitter = "not some handle";
(getApplicationById as any).mockResolvedValue(grantApplication);
renderWithContext(, {
@@ -461,7 +462,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
projectGithubOverride: handle,
});
- grantApplication.project.projectGithub = "not some handle";
+ grantApplication.project!.projectGithub = "not some handle";
(getApplicationById as any).mockResolvedValue(grantApplication);
renderWithContext(, {
@@ -489,7 +490,7 @@ describe("ViewApplicationPage verification badges", () => {
applicationIdOverride,
...overrides,
});
- grantApplicationData.project.owners.forEach((it) => {
+ grantApplicationData.project!.owners.forEach((it) => {
it.address = "bad";
});
(getApplicationById as any).mockResolvedValue(grantApplicationData);
@@ -514,10 +515,7 @@ export const renderWithContext = (
render(
({
}),
}));
-describe("the view round page", () => {
+describe("View Round", () => {
beforeEach(() => {
(useParams as jest.Mock).mockImplementation(() => {
return {
@@ -65,7 +56,7 @@ describe("the view round page", () => {
(useDisconnect as jest.Mock).mockReturnValue({});
});
- it("should display 404 when there no round is found", () => {
+ it("displays a 404 when there no round is found", () => {
(useParams as jest.Mock).mockReturnValueOnce({
id: undefined,
});
@@ -91,7 +82,7 @@ describe("the view round page", () => {
expect(screen.getByText("404 ERROR")).toBeInTheDocument();
});
- it("should display access denied when wallet accessing is not round operator", () => {
+ it("displays access denied when wallet accessing is not round operator", () => {
render(
wrapWithBulkUpdateGrantApplicationContext(
wrapWithApplicationContext(
@@ -111,7 +102,7 @@ describe("the view round page", () => {
expect(screen.getByText("Access Denied!")).toBeInTheDocument();
});
- it("should display Copy to Clipboard", () => {
+ it("displays Copy to Clipboard", () => {
render(
wrapWithBulkUpdateGrantApplicationContext(
wrapWithApplicationContext(
@@ -128,7 +119,7 @@ describe("the view round page", () => {
expect(screen.getByText("Copy to clipboard")).toBeInTheDocument();
});
- it("should display copy when there are no applicants for a given round", () => {
+ it("displays copy when there are no applicants for a given round", () => {
render(
wrapWithBulkUpdateGrantApplicationContext(
wrapWithApplicationContext(
@@ -149,7 +140,7 @@ describe("the view round page", () => {
expect(screen.getByText("No Applications")).toBeInTheDocument();
});
- it("should indicate how many of each kind of application there are", () => {
+ it("indicates how many of each kind of application there are", () => {
const mockApplicationData: GrantApplication[] = [
makeGrantApplicationData(),
makeGrantApplicationData(),
@@ -191,7 +182,7 @@ describe("the view round page", () => {
).toBe(1);
});
- it("should display loading spinner when round is loading", () => {
+ it("displays loading spinner when round is loading", () => {
render(
wrapWithApplicationContext(
wrapWithReadProgramContext(
@@ -206,33 +197,19 @@ describe("the view round page", () => {
expect(screen.getByTestId("loading-spinner")).toBeInTheDocument();
});
-});
-export const renderWithContext = (
- ui: JSX.Element,
- grantApplicationStateOverrides: Partial = {},
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- dispatch: any = jest.fn()
-) =>
- render(
-
-
-
- {ui}
-
-
-
- );
+ it("displays option to view round's explorer", () => {
+ render(
+ wrapWithApplicationContext(
+ wrapWithReadProgramContext(
+ wrapWithRoundContext(, {
+ data: [mockRoundData],
+ })
+ )
+ )
+ );
+ const roundExplorer = screen.getByTestId("round-explorer");
+
+ expect(roundExplorer).toBeInTheDocument();
+ });
+});
diff --git a/packages/round-manager/src/test-utils.tsx b/packages/round-manager/src/test-utils.tsx
index eaf69cddc6..21c974f30f 100644
--- a/packages/round-manager/src/test-utils.tsx
+++ b/packages/round-manager/src/test-utils.tsx
@@ -293,17 +293,13 @@ export const wrapWithRoundContext = (
export const wrapWithBulkUpdateGrantApplicationContext = (
ui: JSX.Element,
- bulkUpdateOverrides: Partial = {},
+ bulkUpdateOverrides: Partial = {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- dispatch: any = jest.fn()
) => (
{ui}