2
0

Add e2e tests for account

This commit is contained in:
Baptiste Arnaud
2021-12-28 11:13:09 +01:00
parent e10fe1a186
commit 8c826fcf70
13 changed files with 321 additions and 302 deletions

View File

@ -1,6 +1,7 @@
import { Stack, Heading, HStack, Button, Text } from '@chakra-ui/react'
import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
import { useUser } from 'contexts/UserContext'
import { Plan } from 'db'
import React from 'react'
import { SubscriptionTag } from './SubscriptionTag'
@ -17,10 +18,13 @@ export const BillingSection = () => {
<SubscriptionTag plan={user?.plan} />
</HStack>
{user?.stripeId && (
<Button as={NextChakraLink} href="test">
Billing portal
<Button as={NextChakraLink} href="/api/stripe/customer-portal">
Manage my subscription
</Button>
)}
{user?.plan === Plan.FREE && (
<Button colorScheme="blue">Upgrade</Button>
)}
</Stack>
</Stack>
)