From 3373ce8e90d04b9b214d52dc8c9f07879f060667 Mon Sep 17 00:00:00 2001 From: Traumschule <31551045+traumschule@users.noreply.github.com> Date: Thu, 24 Nov 2022 09:17:11 +0000 Subject: [PATCH] Votes backup CTA on `VoteForCouncilSuccessModal` (#1633) (#3797) * Votes backup CTA on `VoteForCouncilSuccessModal` (#1633) * whitespace * mock URL * Fix linting and tests Co-authored-by: Joystream Stats Co-authored-by: Theophile Sandoz --- .../modals/VoteForCouncil/VoteForCouncilSuccessModal.tsx | 5 +++-- packages/ui/test/council/pages/Election.test.tsx | 3 --- packages/ui/test/setup.ts | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/ui/src/council/modals/VoteForCouncil/VoteForCouncilSuccessModal.tsx b/packages/ui/src/council/modals/VoteForCouncil/VoteForCouncilSuccessModal.tsx index 1bef3f3aba..34fb30bdcd 100644 --- a/packages/ui/src/council/modals/VoteForCouncil/VoteForCouncilSuccessModal.tsx +++ b/packages/ui/src/council/modals/VoteForCouncil/VoteForCouncilSuccessModal.tsx @@ -6,6 +6,7 @@ import { ButtonGhost } from '@/common/components/buttons' import { SuccessIcon } from '@/common/components/icons' import { Modal, ModalFooter, ModalHeader, SuccessModalBody } from '@/common/components/Modal' import { TextMedium } from '@/common/components/typography' +import { BackupVotesButton } from '@/council/components/election/BackupVotesButton' import { ElectionRoutes } from '@/council/constants' import { useCandidate } from '@/council/hooks/useCandidate' import { SelectedMember } from '@/memberships/components/SelectMember' @@ -30,9 +31,9 @@ export const VoteForCouncilSuccessModal = ({ onClose, candidateId }: Props) => { - You have just successfully voted for the Candidate + You have just successfully voted for the Candidate. This is a good time to backup your votes. - + diff --git a/packages/ui/test/council/pages/Election.test.tsx b/packages/ui/test/council/pages/Election.test.tsx index a440fe61a3..eeddf7d2a3 100644 --- a/packages/ui/test/council/pages/Election.test.tsx +++ b/packages/ui/test/council/pages/Election.test.tsx @@ -103,9 +103,6 @@ describe('UI: Election page', () => { }, } - URL.createObjectURL = jest.fn() - URL.revokeObjectURL = jest.fn() - const castVote = ( castBy: string, optionId: string, diff --git a/packages/ui/test/setup.ts b/packages/ui/test/setup.ts index 80d94def19..339ca13279 100644 --- a/packages/ui/test/setup.ts +++ b/packages/ui/test/setup.ts @@ -107,6 +107,9 @@ declare global { } } +global.URL.createObjectURL = jest.fn() +global.URL.revokeObjectURL = jest.fn() + expect.extend({ toBeBN: (received: any, expected: BN) => { if (!BN.isBN(received)) {