Skip to content

Commit

Permalink
add vitest and first unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmg1434 committed Dec 18, 2024
1 parent 02f467a commit c393c9b
Show file tree
Hide file tree
Showing 5 changed files with 2,444 additions and 47 deletions.
10 changes: 10 additions & 0 deletions __tests__/page.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, test } from 'vitest'
import { render, screen } from '@testing-library/react'
import Page from '../app/page'
import Home from '../app/page'

test('Home', () => {
render(<Home />)
expect(screen.getByRole('main')).toBeDefined()
expect(screen.getByText('Cardservo')).toBeDefined()
})
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { SearchBar } from "./components/search-bar";

export default function Home() {
return (
<div>
<>
<Navbar />
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
Expand All @@ -25,6 +25,6 @@ export default function Home() {
<footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
</footer>
</div>
</div>
</>
);
}
Loading

0 comments on commit c393c9b

Please sign in to comment.