Add end-to-end tests for user and team billing features
This commit introduces end-to-end tests for the user and team billing features. It also enhances existing billing configurations, logging, and error handling mechanisms. Refactoring has been done to simplify the code and make it more readable. Adjustments have also been made in the visual aspects of some components. The addition of these tests will help ensure the reliability of the billing features.
This commit is contained in:
@@ -10,12 +10,8 @@ export function SitePageHeader(props: {
|
||||
<div className={'container flex flex-col space-y-4'}>
|
||||
<h1 className={'font-base text-3xl xl:text-5xl'}>{props.title}</h1>
|
||||
|
||||
<h2
|
||||
className={
|
||||
'text-base text-secondary-foreground xl:text-lg 2xl:text-xl'
|
||||
}
|
||||
>
|
||||
<span className={'font-normal'}>{props.subtitle}</span>
|
||||
<h2 className={'text-muted-foreground xl:text-lg 2xl:text-xl'}>
|
||||
{props.subtitle}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
|
||||
import { Cms } from '@kit/cms';
|
||||
import { Button } from '@kit/ui/button';
|
||||
import { If } from '@kit/ui/if';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
import { cn } from '@kit/ui/utils';
|
||||
|
||||
import { CoverImage } from '~/(marketing)/blog/_components/cover-image';
|
||||
@@ -17,25 +11,27 @@ export const PostHeader: React.FC<{
|
||||
const { title, publishedAt, description, image } = post;
|
||||
|
||||
return (
|
||||
<div className={'flex flex-col'}>
|
||||
<div className={'flex flex-1 flex-col'}>
|
||||
<div className={cn('border-b py-8')}>
|
||||
<div className={'container flex flex-col space-y-4'}>
|
||||
<div className={'mx-auto flex max-w-3xl flex-col space-y-4'}>
|
||||
<h1 className={'text-3xl font-semibold xl:text-5xl'}>{title}</h1>
|
||||
|
||||
<h2 className={'text-base text-secondary-foreground xl:text-lg'}>
|
||||
<span
|
||||
className={'font-normal'}
|
||||
dangerouslySetInnerHTML={{ __html: description ?? '' }}
|
||||
/>
|
||||
</h2>
|
||||
<div>
|
||||
<span className={'text-muted-foreground'}>
|
||||
<DateFormatter dateString={publishedAt.toISOString()} />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<DateFormatter dateString={publishedAt.toISOString()} />
|
||||
<h2
|
||||
className={'text-base text-muted-foreground xl:text-lg'}
|
||||
dangerouslySetInnerHTML={{ __html: description ?? '' }}
|
||||
></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<If condition={image}>
|
||||
{(imageUrl) => (
|
||||
<div className="relative mx-auto mt-8 flex h-[378px] w-full max-w-2xl justify-center">
|
||||
<div className="relative mx-auto mt-8 flex h-[378px] w-full max-w-3xl justify-center">
|
||||
<CoverImage
|
||||
preloadImage
|
||||
className="rounded-md"
|
||||
|
||||
@@ -12,7 +12,7 @@ export const Post: React.FC<{
|
||||
<div>
|
||||
<PostHeader post={post} />
|
||||
|
||||
<div className={'mx-auto flex max-w-2xl flex-col space-y-6 py-8'}>
|
||||
<div className={'mx-auto flex max-w-3xl flex-col space-y-6 py-8'}>
|
||||
<article className={styles.HTML}>
|
||||
<ContentRenderer content={content} />
|
||||
</article>
|
||||
|
||||
@@ -39,11 +39,13 @@ export async function POST(request: Request) {
|
||||
);
|
||||
|
||||
return new Response('OK', { status: 200 });
|
||||
} catch (e) {
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
logger.error(
|
||||
{
|
||||
name: 'billing',
|
||||
error: e,
|
||||
error: JSON.stringify(error),
|
||||
},
|
||||
`Failed to process billing webhook`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user