Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for feedback and governance actions, fix auth and proposal issues, and remove outdated tests, chore: bumppdf-ui to v0.2.8 #1539

Merged
merged 67 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
6123621
test: 6M navigate between footer links
kneerose Jul 8, 2024
d6e62fa
test: 6N open feedback modal on feedback button action
kneerose Jul 8, 2024
bcec5a8
test: Add test 6O verify bug report form
kneerose Jul 8, 2024
0b1dd64
test: Add test 6P verify feature form
kneerose Jul 8, 2024
c009b1e
chore: Add usersnap page and use usersnap page on it test
kneerose Jul 8, 2024
82df0c4
chore: bump cardano-test-wallet version to 2.0.1
NabinKawan Jul 8, 2024
4c19fc9
Merge pull request #1518 from IntersectMBO/bugfix/test-1D-reject-main…
NabinKawan Jul 8, 2024
3c8cbf3
test: Add test 6Q report an issue
kneerose Jul 8, 2024
294292c
test: Add test 6R submit an idea or new feature
kneerose Jul 9, 2024
42b2e80
chore: Mock info-proposed-govactions
NabinKawan Jul 3, 2024
eebc4a5
fix: Get all proposed govactions
NabinKawan Jul 3, 2024
68c3b29
fix: Test proposal-discussion-forum logged out tests
NabinKawan Jul 3, 2024
d90dbe7
fix: Proposal auth setup and Create proposal fixture
NabinKawan Jul 4, 2024
1b63485
fix: Test 8G
NabinKawan Jul 4, 2024
15b5f12
fix: Test comments (user/anonymous)
NabinKawan Jul 4, 2024
c480e6b
feat: Add new proposal wallet
NabinKawan Jul 4, 2024
3467c36
fix: Proposal 01 auth setup
NabinKawan Jul 5, 2024
27bbd72
fix: Polling tests and Skip test anonymous comment
NabinKawan Jul 5, 2024
5747577
fix: Refactor 6I, 6J tests acc to new flow
NabinKawan Jul 5, 2024
a27057e
chore: Skip test 8M (Anonymous comment)
NabinKawan Jul 5, 2024
e14318a
fix: resolve conflict of verify btn in logged in/out state
NabinKawan Jul 9, 2024
302143d
test: filter proposed governance actions
NabinKawan Jul 9, 2024
cd926e3
test: sort proposed governance actions
NabinKawan Jul 9, 2024
676c9cf
Refactor: Remove user page and use locator directly in tests
kneerose Jul 9, 2024
a157477
chore: remove test (8M,8O)
NabinKawan Jul 9, 2024
59d8281
Merge pull request #1479 from IntersectMBO/bugfix/pdf-tests
NabinKawan Jul 9, 2024
d7e560b
test: Disable annonymous comment
NabinKawan Jul 5, 2024
aa054bb
test: Username validation
NabinKawan Jul 5, 2024
060cbbe
Merge pull request #1480 from IntersectMBO/extended/pdf-tests
NabinKawan Jul 9, 2024
25593f5
Merge pull request #1529 from IntersectMBO/feat/user-snap
kneerose Jul 9, 2024
c260ee7
chore: Update proposal creation request type and its form validation
kneerose Jul 3, 2024
00ebc29
chore: Update Test 7C flow to show unfinished draft list per latest u…
kneerose Jul 3, 2024
eacecd9
fix: test 7D according to new flow
kneerose Jul 3, 2024
642b696
chore: Update the fill-up form flow and the generated valid field fak…
kneerose Jul 3, 2024
c27177a
Fix: Update test 7E `Accept valid proposal form` according to the new…
kneerose Jul 3, 2024
9c91cc4
Fix: Update test 7F `Reject invalid proposal form` according to the n…
kneerose Jul 3, 2024
4a9f91e
chore: Update generate valid and invalid proposal form field props type
kneerose Jul 3, 2024
15b9fe7
chore: Refactor test 7G flow to create a proposal with proper data
kneerose Jul 3, 2024
1fe3e0a
chore: Update test 7I review fillup form flow
kneerose Jul 3, 2024
a3292c0
chore: Update metadata anchor validation test
kneerose Jul 4, 2024
41eee95
chore: Update reject invalid metadata test
kneerose Jul 4, 2024
67f12cc
chore: Migrate 7J and 7K test from proposal submission functionality …
kneerose Jul 4, 2024
71bb185
feat: Add Tests 7L, 7M, and 7N Related to Proposal Draft
kneerose Jul 4, 2024
333d694
chore: Rename proposal.setup.ts file to governance-action.setup.ts
kneerose Jul 4, 2024
200d6be
chore: Update project proposals on playwright config
kneerose Jul 4, 2024
87c8306
chore: Update test 7H to submit a proposal as a governance action acc…
kneerose Jul 4, 2024
e9397d4
chore: Remove duplicate proposal create request and fix proposal link…
kneerose Jul 4, 2024
6cf54c1
chore: Remove unused functions and change the reward address on the p…
kneerose Jul 5, 2024
559a4ae
chore: Add missing elements in proposal Discussing page
kneerose Jul 5, 2024
30b0986
chore: Handle the 'Create Proposal' or 'continue' button on the propo…
kneerose Jul 5, 2024
121e487
chore: Migrate proposalSubmissionVisibility.loggedin test to proposal…
kneerose Jul 5, 2024
636fc16
chore: Update create proposal logic
kneerose Jul 5, 2024
bd4b895
chore: Refactor proposal auth and proposal fixture
kneerose Jul 5, 2024
9a23dd8
chore: Update proposal discussion navigation url and add amount input…
kneerose Jul 6, 2024
d785ebd
fix: Test 7J and 7K
kneerose Jul 9, 2024
665d584
chore: bump @intersect.mbo/pdf-ui to v0.2.8
j-dyczka Jul 9, 2024
a5e1a63
Merge pull request #1541 from IntersectMBO/chore/bump-pdf-ui
jdyczka Jul 9, 2024
2f7cc12
chore: Add temporary proposal users for draft test
kneerose Jul 10, 2024
ea05e08
chore: Add missing verify identity button action
kneerose Jul 10, 2024
f1202aa
Merge pull request #1507 from IntersectMBO/refactor/proposal-submission
kneerose Jul 10, 2024
63cea33
chore: update cardano test wallet version in package-lock
kneerose Jul 10, 2024
b76e6fb
Merge pull request #1546 from IntersectMBO/refactor/proposal-submission
kneerose Jul 10, 2024
717be69
fix: verify identity on navigation to proposal discussion page
NabinKawan Jul 10, 2024
a5f54d9
Merge pull request #1547 from IntersectMBO/bugfix/test-pdf-miscellaneous
NabinKawan Jul 10, 2024
6ae83ed
chore: add 2s wait timeout after navigated to proposal discussion
kneerose Jul 10, 2024
073338f
fix: verify identity on navigation to proposal creation
kneerose Jul 10, 2024
f3954ac
Merge pull request #1548 from IntersectMBO/bugfix/test-proposal-draft
kneerose Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@emurgo/cardano-serialization-lib-asmjs": "12.0.0-alpha.29",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.2.7",
"@intersect.mbo/pdf-ui": "^0.2.8",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const ProposeGovActionDashboardCard = ({

navigate(
isProposalDiscussionForumEnabled
? PDF_PATHS.proposalDiscussion
? PDF_PATHS.proposalDiscussionPropose
: PATHS.createGovernanceAction,
);
}, [deposit, votingPower, isProposalDiscussionForumEnabled]);
Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/src/consts/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export const PATHS = {
export const PDF_PATHS = {
proposalDiscussion: "/proposal_discussion",
proposalDiscussionProposal: "/proposal_discussion/:id",
proposalDiscussionPropose: "/proposal_discussion/propose",
};
8 changes: 4 additions & 4 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1581,10 +1581,10 @@
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.0.8.tgz"
integrity sha512-Y+5vYGlF3Smg/QscQT/4ZwsKTNm2C0GCs2czzYWrE4O4RV2YAAg9MZkQ52u8uZp3cEW0h9vr+f9W9ihhwsNHGQ==

"@intersect.mbo/pdf-ui@^0.2.7":
version "0.2.7"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.2.7.tgz"
integrity sha512-vYmxs2F5Grk0Np/DfcytaXiPfgP8YWUYTKoWriS1DWSUdKZgj27DYQbPIL3dRjUW6kOC7rFDdbNQR9bZJ2YVkw==
"@intersect.mbo/pdf-ui@^0.2.8":
version "0.2.8"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.2.8.tgz"
integrity sha512-ioksMZ3G5PJ1RCZPJb5Ui6lKz6bgSk5R5HbjTCY1+AQIDjLIlYE0+gslwqxl1NDF6pLevJUGX+TZAXJgYUd6Vg==
dependencies:
"@fontsource/poppins" "^5.0.14"
"@intersect.mbo/intersectmbo.org-icons-set" "^1.0.8"
Expand Down
49 changes: 49 additions & 0 deletions tests/govtool-frontend/playwright/lib/_mock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,29 @@ export const invalid = {
return " ";
},

username: () => {
const choice = faker.number.int({ min: 1, max: 6 });
if (choice === 1) {
// Contains a space, which is invalid
return faker.lorem.word() + " " + faker.lorem.word();
} else if (choice === 2) {
// Exceeds 30 characters, which is invalid
return faker.lorem.words(31).replace(/\s+/g, "");
} else if (choice === 3) {
// Starts with a period, which is invalid
return "." + faker.internet.userName();
} else if (choice === 4) {
// Starts with an underscore, which is invalid
return "_" + faker.internet.userName();
} else if (choice === 5) {
// Contains an invalid character, such as a symbol
return faker.internet.userName() + "#";
} else if (choice === 6) {
// Contains a hyphen
return faker.internet.userName() + "-";
}
},

email: () => {
const choice = faker.number.int({ min: 1, max: 3 });

Expand Down Expand Up @@ -71,3 +94,29 @@ export const invalid = {
return " ";
},
};

export const valid = {
username: () => {
let username = faker.internet.userName().toLowerCase();

// Remove any invalid characters
username = username.replace(/[^a-z0-9._]/g, "");

// Ensure the username is between 1 and 30 characters
if (username.length > 30) {
username = username.substring(0, 30);
}

// Ensure the first character is not a period or underscore
if (username.startsWith(".") || username.startsWith("_")) {
username = "a" + username.substring(1);
}

// Ensure the username is not empty after the transformations
if (username.length === 0) {
username = "user" + faker.number.int({ min: 1, max: 9999 });
}

return username;
},
};
Loading
Loading