summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/json-ld.test.tsx2
-rw-r--r--src/components/json-ld.tsx2
-rw-r--r--src/components/ui/button.test.tsx15
3 files changed, 13 insertions, 6 deletions
diff --git a/src/components/json-ld.test.tsx b/src/components/json-ld.test.tsx
index c96e5c3..6a81414 100644
--- a/src/components/json-ld.test.tsx
+++ b/src/components/json-ld.test.tsx
@@ -46,7 +46,7 @@ describe('json-ld components', () => {
});
test('returns null when post is not provided', () => {
- const { container } = render(<PostJsonLd post={null as unknown as any} />);
+ const { container } = render(<PostJsonLd post={null} />);
expect(container.firstChild).toBeNull();
});
diff --git a/src/components/json-ld.tsx b/src/components/json-ld.tsx
index 58cb0ba..bbfad33 100644
--- a/src/components/json-ld.tsx
+++ b/src/components/json-ld.tsx
@@ -4,7 +4,7 @@ import { baseUrl } from '@/lib/constants';
import type { BlogPost } from '@/lib/payload-posts';
import type { BlogPosting, BreadcrumbList, Graph } from 'schema-dts';
-export const PostJsonLd = ({ post }: { post: BlogPost }) => {
+export const PostJsonLd = ({ post }: { post: BlogPost | null | undefined }) => {
if (!post) {
return null;
}
diff --git a/src/components/ui/button.test.tsx b/src/components/ui/button.test.tsx
index 314e9bf..f8bd3a9 100644
--- a/src/components/ui/button.test.tsx
+++ b/src/components/ui/button.test.tsx
@@ -14,9 +14,16 @@ describe('Button', () => {
// Test buttons with different variants
test('renders button with different variants', () => {
- const variants = ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'];
+ const variants = [
+ 'default',
+ 'destructive',
+ 'outline',
+ 'secondary',
+ 'ghost',
+ 'link',
+ ] as const;
variants.forEach((variant) => {
- render(<Button variant={variant as any}>{variant} Variant</Button>);
+ render(<Button variant={variant}>{variant} Variant</Button>);
const button = screen.getByText(`${variant} Variant`);
expect(button).toBeInTheDocument();
});
@@ -24,9 +31,9 @@ describe('Button', () => {
// Test buttons with different sizes
test('renders button with different sizes', () => {
- const sizes = ['default', 'sm', 'lg', 'icon'];
+ const sizes = ['default', 'sm', 'lg', 'icon'] as const;
sizes.forEach((size) => {
- render(<Button size={size as any}>{size} Size</Button>);
+ render(<Button size={size}>{size} Size</Button>);
const button = screen.getByText(`${size} Size`);
expect(button).toBeInTheDocument();
});