Skip to content

Commit

Permalink
Votes backup CTA on VoteForCouncilSuccessModal (Joystream#1633) (Jo…
Browse files Browse the repository at this point in the history
…ystream#3797)

* Votes backup CTA on `VoteForCouncilSuccessModal` (Joystream#1633)

* whitespace

* mock URL

* Fix linting and tests

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
  • Loading branch information
3 people authored Nov 24, 2022
1 parent 0f7ae3b commit 3373ce8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -30,9 +31,9 @@ export const VoteForCouncilSuccessModal = ({ onClose, candidateId }: Props) => {

<SuccessModalBody>
<TextMedium margin="l" light>
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.
</TextMedium>

<BackupVotesButton cycleId={candidate?.cycleId} />
<SelectedMember size="l" member={candidate?.member} hideGroup />
</SuccessModalBody>

Expand Down
3 changes: 0 additions & 3 deletions packages/ui/test/council/pages/Election.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ describe('UI: Election page', () => {
},
}

URL.createObjectURL = jest.fn()
URL.revokeObjectURL = jest.fn()

const castVote = (
castBy: string,
optionId: string,
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3373ce8

Please sign in to comment.