diff --git a/src/__tests__/contexts/rewards-context.spec.tsx b/src/__tests__/contexts/rewards-context.spec.tsx new file mode 100644 index 0000000..1add78e --- /dev/null +++ b/src/__tests__/contexts/rewards-context.spec.tsx @@ -0,0 +1,25 @@ +import { RewardsContext, RewardsContextProvider } from '@/contexts/rewards-context'; +import '@testing-library/jest-dom'; +import { cleanup, render, screen } from '@testing-library/react'; +import { useContext } from 'react'; + +function MockChildComponent() { + const {rewards} = useContext(RewardsContext); + return ( +
+ Closing the voter registration gap has to be a community effort, so we're asking everyone to join us in taking the #8by8Challenge—register 8 friends to register to vote in 8 days! +
+ ++ Already have an account? + + + Sign in + +
+ + See why others are doing it + ++ Sign up with your name and email address to get started. +
+ ++ Get 8 friends via social media or messaging apps to join your challenge. +
+ ++ Your friends can support your challenge by taking 1 of 3 actions: register to vote, set up election reminders, or take the challenge themselves. You'll earn 1 badge per friend who takes action! +
+ ++ When you get 8 badges in 8 days, you win the challenge! Most importantly, you helped the community move closer to greater AAPI representation! +
+ + ++ Already have an account? + + + Sign in + +
++ Closing the voter registration gap has to be a community effort, so + we're asking everyone to join us in taking the + #8by8Challenge—register 8 friends to register to vote in 8 days! +
+ + + + {!activeUser && ( ++ Already have an account?{" "} + + Sign in + +
+ )} + + + See why others are doing it + ++ Sign up with your name and email address to get started. +
++ Get 8 friends via social media or messaging apps to join your + challenge. +
++ Your friends can support your challenge by taking 1 of 3 actions: + register to vote, set up election reminders, or take the challenge + themselves. You'll earn 1 badge per friend who takes action! +
++ {rewardsAvailable ? + "When all 8 of your friends took action in your challenge within 8 days, and you win! Then select and enjoy a reward from one of our amazing partners." : + "When you get 8 badges in 8 days, you win the challenge! Most importantly, you helped the community move closer to greater AAPI representation!"} +
++ Already have an account?{" "} + + Sign in + +
+ )} +