-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
bun run check | ||
bun run test | ||
bun run bump:version | ||
git add . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ components.json | |
tsconfig.tsbuildinfo | ||
*.test.* | ||
*.spec.* | ||
vitest.config.ts | ||
vitest.config.ts | ||
setupTests.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Loader } from './loader'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
describe('Loader', () => { | ||
test('renders image without crashing', () => { | ||
render(<Loader />); | ||
const loaderImage = screen.getByAltText('Loading'); | ||
expect(loaderImage).toBeInTheDocument(); | ||
}); | ||
|
||
test('displays default loading text when no loadingText prop is provided', () => { | ||
render(<Loader />); | ||
const loadingText = screen.getByText('Loading…'); | ||
expect(loadingText).toBeInTheDocument(); | ||
}); | ||
|
||
test('displays custom loading text when loadingText prop is provided', () => { | ||
const customText = 'Custom loading text'; | ||
render(<Loader loadingText={customText} />); | ||
const loadingText = screen.getByText(customText); | ||
expect(loadingText).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Required } from './required'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
describe('Required', () => { | ||
test('renders without crashing', () => { | ||
render(<Required />); | ||
const requiredElement = screen.getByText('*'); | ||
expect(requiredElement).toBeInTheDocument(); | ||
}); | ||
|
||
test('displays an asterisk (*)', () => { | ||
render(<Required />); | ||
const requiredElement = screen.getByText('*'); | ||
expect(requiredElement.textContent).toBe('*'); | ||
}); | ||
|
||
test('has a class name of "text-destructive"', () => { | ||
render(<Required />); | ||
const requiredElement = screen.getByText('*'); | ||
expect(requiredElement).toHaveClass('text-destructive'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { Separator } from './separator'; | ||
|
||
describe('Separator', () => { | ||
it('renders without crashing', () => { | ||
render(<Separator />); | ||
const separatorElement = screen.getByRole('separator'); | ||
expect(separatorElement).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders with default props', () => { | ||
render(<Separator />); | ||
const separatorElement = screen.getByRole('separator'); | ||
expect(separatorElement).toHaveClass('shrink-0 bg-border h-[1px] w-full'); | ||
}); | ||
|
||
it('renders correctly with custom props', () => { | ||
render(<Separator orientation="vertical" />); | ||
const separatorElement = screen.getByRole('separator'); | ||
expect(separatorElement).toHaveClass('shrink-0 bg-border h-full w-[1px]'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "@testing-library/jest-dom"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters