diff --git a/__tests__/__snapshots__/index.test.tsx.snap b/__tests__/__snapshots__/index.test.tsx.snap index e76a1fd..41d1f31 100644 --- a/__tests__/__snapshots__/index.test.tsx.snap +++ b/__tests__/__snapshots__/index.test.tsx.snap @@ -14,7 +14,7 @@ exports[`Home renders homepage unchanged 1`] = ` No 1 task management app

Tasko helps teams move

diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts new file mode 100644 index 0000000..11bc331 --- /dev/null +++ b/__tests__/utils.test.ts @@ -0,0 +1,40 @@ +import { cn, absoluteUrl } from '@/lib/utils'; + +describe('absoluteUrl', () => { + const originalEnv = process.env; + + beforeEach(() => { + process.env = { + ...originalEnv, + NEXT_PUBLIC_APP_URL: 'https://example.com', + }; + }); + + afterEach(() => { + process.env = originalEnv; + }); + + it('should return the correct absolute URL', () => { + const pathname = '/test'; + expect(absoluteUrl(pathname)).toBe('https://example.com/test'); + }); + + it('should handle empty pathname', () => { + const pathname = ''; + expect(absoluteUrl(pathname)).toBe('https://example.com'); + }); +}); + +describe('cn', () => { + it('should merge multiple class names', () => { + expect(cn('class1', 'class2')).toBe('class1 class2'); + }); + + it('should handle conditional class names', () => { + const isActive = true; + expect(cn('base', isActive && 'active')).toBe('base active'); + + const isDisabled = false; + expect(cn('base', isDisabled && 'disabled')).toBe('base'); + }); +}); diff --git a/app/(main)/_components/footer.tsx b/app/(main)/_components/footer.tsx index bf6da7a..bea046b 100644 --- a/app/(main)/_components/footer.tsx +++ b/app/(main)/_components/footer.tsx @@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button'; export const Footer = () => { return ( -
+
diff --git a/app/(main)/_components/navbar.tsx b/app/(main)/_components/navbar.tsx index b8374e0..335e7a1 100644 --- a/app/(main)/_components/navbar.tsx +++ b/app/(main)/_components/navbar.tsx @@ -3,6 +3,7 @@ import { auth } from '@clerk/nextjs/server'; import { Logo } from '@/components/logo'; import { Button } from '@/components/ui/button'; +import { ModeToggle } from '@/components/ui/mode-toggle'; export const Navbar = async () => { const { userId } = await auth(); @@ -10,7 +11,7 @@ export const Navbar = async () => { let isSignedIn = !!userId; return ( -
+
+ ); }; diff --git a/app/(main)/blog/page.tsx b/app/(main)/blog/page.tsx index 4e956f5..6951af9 100644 --- a/app/(main)/blog/page.tsx +++ b/app/(main)/blog/page.tsx @@ -5,7 +5,9 @@ import Link from 'next/link'; const BlogPage = () => { return (
-

Blog

+

+ Blog +

{allBlogPosts.map((post) => (
@@ -17,10 +19,12 @@ const BlogPage = () => { alt='post cover image' className='aspect-video w-full rounded-md object-cover' /> -

+

{post.title}

-

{post.summary}

+

+ {post.summary} +

))} diff --git a/app/(main)/layout.tsx b/app/(main)/layout.tsx index 9cdd5d6..2a2dc51 100644 --- a/app/(main)/layout.tsx +++ b/app/(main)/layout.tsx @@ -3,9 +3,11 @@ import { Navbar } from './_components/navbar'; const MarketingLayout = ({ children }: { children: React.ReactNode }) => { return ( -
+
-
{children}
+
+ {children} +
); diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx index ab5657e..d525869 100644 --- a/app/(main)/page.tsx +++ b/app/(main)/page.tsx @@ -26,7 +26,7 @@ const MarketingPage = () => { No 1 task management app
-

+

Tasko helps teams move

diff --git a/app/(platform)/(dashboard)/_components/Navbar.tsx b/app/(platform)/(dashboard)/_components/Navbar.tsx index d05701a..60a131c 100644 --- a/app/(platform)/(dashboard)/_components/Navbar.tsx +++ b/app/(platform)/(dashboard)/_components/Navbar.tsx @@ -6,10 +6,11 @@ import { Button } from '@/components/ui/button'; import { FormPopover } from '@/components/form/form-popover'; import { MobileSidebar } from './mobile-sidebar'; +import { ModeToggle } from '@/components/ui/mode-toggle'; export const Navbar = () => { return ( -