Fix E2E tests + bug if you do rly bad in voting

This commit is contained in:
Kalle 2022-07-06 10:21:41 +03:00
parent 8779974607
commit 55e559c348
4 changed files with 13 additions and 12 deletions

View File

@ -74,7 +74,7 @@ export default function PlusVotingResultsPage() {
<span className="plus-history__fail">didn&apos;t pass</span>
)}{" "}
the +{result.tier} voting
{result.score
{typeof result.score === "number"
? `, your score was ${result.score}% (at least 50% required to pass)`
: ""}
</li>

View File

@ -62,19 +62,20 @@ describe("Plus voting results page", () => {
cy.seed();
});
it("does not see results but sees own percentage as a failed suggest", () => {
it("sees own % and results as a failed suggest", () => {
cy.auth(200);
cy.visit("/plus/voting/results");
cy.contains("Sendou").should("not.exist");
cy.contains("Sendou");
cy.contains("your score was");
});
it("views full results as member who passed", () => {
it("views results without % as member who passed", () => {
cy.auth(1);
cy.visit("/plus/voting/results");
cy.contains("Sendou");
cy.contains("passed");
});
// xxx: figure out a good way to do plus server tests with serverside isVotingActive or delete existing tests

14
package-lock.json generated
View File

@ -35,7 +35,7 @@
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"cross-env": "^7.0.3",
"cypress": "^10.2.0",
"cypress": "^10.3.0",
"dotenv": "^16.0.1",
"eslint": "^8.19.0",
"eslint-plugin-react": "^7.30.1",
@ -5313,9 +5313,9 @@
"dev": true
},
"node_modules/cypress": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.2.0.tgz",
"integrity": "sha512-+i9lY5ENlfi2mJwsggzR+XASOIgMd7S/Gd3/13NCpv596n3YSplMAueBTIxNLcxDpTcIksp+9pM3UaDrJDpFqA==",
"version": "10.3.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz",
"integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
@ -19401,9 +19401,9 @@
"dev": true
},
"cypress": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.2.0.tgz",
"integrity": "sha512-+i9lY5ENlfi2mJwsggzR+XASOIgMd7S/Gd3/13NCpv596n3YSplMAueBTIxNLcxDpTcIksp+9pM3UaDrJDpFqA==",
"version": "10.3.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz",
"integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==",
"dev": true,
"requires": {
"@cypress/request": "^2.88.10",

View File

@ -54,7 +54,7 @@
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"cross-env": "^7.0.3",
"cypress": "^10.2.0",
"cypress": "^10.3.0",
"dotenv": "^16.0.1",
"eslint": "^8.19.0",
"eslint-plugin-react": "^7.30.1",