Skip to content

Commit 7c9c192

Browse files
authored
Merge pull request #3374 from IntersectMBO/test
2 parents fe34c85 + a57ac5a commit 7c9c192

File tree

9 files changed

+91
-31
lines changed

9 files changed

+91
-31
lines changed

.github/ISSUE_TEMPLATE/feature_idea.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ body:
8585
placeholder: |
8686
As a [ada holder | DRep | Direct voter], I want [some goal] so that [some reason].
8787
validations:
88-
required: false
88+
required: false
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature Suggestion
2+
description: Suggest a new feature or enhancement for GovTool.
3+
labels: ["Feature Request", "Needs UX Review"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value:
8+
Please fill out the following details.
9+
- type: textarea
10+
id: problem-statement
11+
attributes:
12+
label: "💡 Suggestion or feature"
13+
description: "Please describe the user need, idea, or pain point."
14+
placeholder: "Example: Users would benefit from having X functionality, so they can do Y..."
15+
validations:
16+
required: true
17+
- type: textarea
18+
id: user-impact
19+
attributes:
20+
label: "Who does this help?"
21+
description: "Which users will benefit from this feature? How does it improve their experience?"
22+
placeholder: "Example: This feature will help first-time users onboard faster..."
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: dependencies
27+
attributes:
28+
label: "How might we do this?"
29+
description: "Suggestions on implementation"
30+
placeholder: "Example: Add a button that says GO to the home page"
31+
validations:
32+
required: false
33+
- type: textarea
34+
id: other-info
35+
attributes:
36+
label: "Anything else you might want to add?"
37+
description: "Free text box for any comments"
38+
placeholder: "I love GovTool, and so does my dog!"
39+
validations:
40+
required: false

govtool/frontend/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hookform/resolvers": "^3.3.1",
3030
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.3.0",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "0.7.0-beta-8",
32+
"@intersect.mbo/pdf-ui": "0.7.0-beta-11",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@rollup/plugin-babel": "^6.0.4",

govtool/frontend/src/hooks/queries/useGetDRepVotingPowerList.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export const useGetDRepVotingPowerList = () => {
1616
enabled: false,
1717
});
1818

19-
const fetchDRepVotingPowerList = async (identifiers: string[]) =>
19+
const fetchDRepVotingPowerList = async (identifiers: string[] = []) =>
2020
queryClient.fetchQuery({
21-
queryKey: [QUERY_KEYS.useGetDRepVotingPowerListKey],
21+
queryKey: [QUERY_KEYS.useGetDRepVotingPowerListKey, ...identifiers],
2222
queryFn: () => getDRepVotingPowerList(identifiers),
2323
});
2424

govtool/frontend/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,10 +1512,10 @@
15121512
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
15131513
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==
15141514

1515-
"@intersect.mbo/[email protected]8":
1516-
version "0.7.0-beta-8"
1517-
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.7.0-beta-8.tgz"
1518-
integrity sha512-xBd8rl2qC+T5/rHAkDYdD63FoZi84E3LoiVkUZceRzlUcu3/6Ycia8BOzMszS+S9eLPHzYHO6HXy9dOqTObysg==
1515+
"@intersect.mbo/[email protected]11":
1516+
version "0.7.0-beta-11"
1517+
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.7.0-beta-11.tgz"
1518+
integrity sha512-amFT8stsOFMeFZjoTsCpUguUi2d/tlMZ4G/ARud1ewrRfjDvu6PJhGYlGl2gZBGa75GgvNM27hfEbzv7MDOInA==
15191519
dependencies:
15201520
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
15211521
"@fontsource/poppins" "^5.0.14"

tests/govtool-frontend/playwright/lib/_mock/proposalComments.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"comment_text": "Hello",
1010
"createdAt": "2024-06-14T13:38:35.830Z",
1111
"updatedAt": "2024-06-14T13:38:35.830Z",
12+
"bd_proposal_id": null,
13+
"comments_reports": {
14+
"data": []
15+
},
1216
"user_govtool_username": "Anonymous",
1317
"subcommens_number": 0
1418
}
@@ -22,6 +26,10 @@
2226
"comment_text": "Nice proposal",
2327
"createdAt": "2024-06-14T13:38:31.279Z",
2428
"updatedAt": "2024-06-14T13:38:31.279Z",
29+
"bd_proposal_id": null,
30+
"comments_reports": {
31+
"data": []
32+
},
2533
"user_govtool_username": "Anonymous",
2634
"subcommens_number": 0
2735
}
@@ -35,6 +43,10 @@
3543
"comment_text": "Go Ahead",
3644
"createdAt": "2024-06-14T13:38:27.286Z",
3745
"updatedAt": "2024-06-14T13:38:27.286Z",
46+
"bd_proposal_id": null,
47+
"comments_reports": {
48+
"data": []
49+
},
3850
"user_govtool_username": "Anonymous",
3951
"subcommens_number": 0
4052
}

tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test.describe("Proposal created logged state", () => {
3333
await page.goto("/");
3434
await page.getByTestId("proposal-discussion-link").click();
3535

36-
await expect(page.getByText(/proposals/i)).toHaveCount(2);
36+
await expect(page.getByText("Proposals", { exact: true })).toHaveCount(2);
3737
});
3838

3939
test.describe("Accept valid data", () => {

tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.spec.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { test } from "@fixtures/proposal";
88
import { setAllureEpic } from "@helpers/allure";
99
import { isBootStrapingPhase, skipIfNotHardFork } from "@helpers/cardano";
1010
import { injectLogger } from "@helpers/page";
11+
import { extractProposalIdFromUrl } from "@helpers/string";
1112
import { functionWaitedAssert } from "@helpers/waitedLoop";
1213
import ProposalDiscussionDetailsPage from "@pages/proposalDiscussionDetailsPage";
1314
import ProposalDiscussionPage from "@pages/proposalDiscussionPage";
@@ -195,6 +196,31 @@ test("8S. Should restrict proposal creation on disconnected state", async ({
195196
await expect(proposalDiscussionPage.proposalCreateBtn).not.toBeVisible();
196197
});
197198

199+
test("8E. Should share proposed governance action", async ({
200+
page,
201+
context,
202+
}) => {
203+
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
204+
const proposalDiscussionPage = new ProposalDiscussionPage(page);
205+
await proposalDiscussionPage.goto();
206+
207+
await proposalDiscussionPage.viewFirstProposal();
208+
209+
const currentPageUrl = page.url();
210+
const proposalId = extractProposalIdFromUrl(currentPageUrl);
211+
212+
await page.getByTestId("share-button").click();
213+
await page.getByTestId("copy-link").click();
214+
await expect(page.getByTestId("copy-link-text")).toBeVisible();
215+
216+
const copiedTextDRepDirectory = await page.evaluate(() =>
217+
navigator.clipboard.readText()
218+
);
219+
const expectedCopyUrl = `${environments.frontendUrl}/proposal_discussion/${proposalId}`;
220+
221+
expect(copiedTextDRepDirectory).toEqual(expectedCopyUrl);
222+
});
223+
198224
test.describe("Mocked proposal", () => {
199225
let proposalDiscussionDetailsPage: ProposalDiscussionDetailsPage;
200226

@@ -221,24 +247,6 @@ test.describe("Mocked proposal", () => {
221247
await proposalDiscussionDetailsPage.goto(mockProposal.data.id);
222248
});
223249

224-
test("8E. Should share proposed governance action", async ({
225-
page,
226-
context,
227-
}) => {
228-
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
229-
230-
await page.getByTestId("share-button").click();
231-
await page.getByTestId("copy-link").click();
232-
await expect(page.getByTestId("copy-link-text")).toBeVisible();
233-
234-
const copiedTextDRepDirectory = await page.evaluate(() =>
235-
navigator.clipboard.readText()
236-
);
237-
const expectedCopyUrl = `${environments.frontendUrl}/proposal_discussion/${mockProposal.data.id}`;
238-
239-
expect(copiedTextDRepDirectory).toEqual(expectedCopyUrl);
240-
});
241-
242250
test("8I. Should disable poll voting functionality.", async () => {
243251
await expect(proposalDiscussionDetailsPage.pollVoteCard).not.toBeVisible();
244252
await expect(proposalDiscussionDetailsPage.pollYesBtn).not.toBeVisible();

0 commit comments

Comments
 (0)