• Design
  • Shotty
  • Blog
  • Reading
  • Photos
Menu

Jacob Ruiz

Product Designer
  • Design
  • Shotty
  • Blog
  • Reading
  • Photos
graphql-notes@2x.png

GraphQL: Writing Tests for Canceling a Stripe Subscription

July 3, 2019

We’ve already written tests for creating a subscription in Stripe, now it’s time to write some basic tests for the other case: canceling the subscription in Stripe.

First, we can create a function that takes in a cookie string (for authentication), and makes a call to our GraphQL API using Axios.

Now we can use this function to test a couple of cases:

1. It throws an error if the user is not logged in

2. It returns a user if user is logged in and downgrade was successful

← Today's Design System Component: <Breadcrumb />GraphQL: Writing Tests For Our Stripe Subscription Resolvers →
shotty-skinny2x.jpg

Shotty - Faster Access To Your Screenshots on Mac

Shotty is an award-winning Mac app I created to give you instant access to all your recent screenshots, right from the menu bar. You can even add annotations on-the-fly. Stop wasting time digging through Finder for your screenshots. I promise it’ll change your workflow forever (just read the App Store reviews!).



Most popular

information-architecture

Information Architecture: The Most Important Part of Design You're Probably Overlooking

Follow @JacobRuizDesign