Skip to content

Commit 1955938

Browse files
feat: simple button with tests
1 parent 69bb335 commit 1955938

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

components/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# NebraskaCoder Components
2+
3+
These are the components used throughout the web app.

components/controls/Button.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ReactNode } from "react";
2+
3+
interface ButtonProps {
4+
children: ReactNode;
5+
}
6+
7+
const Button = ({ children }: ButtonProps) => {
8+
return <button>{children}</button>;
9+
};
10+
11+
export default Button;

components/controls/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# NebraskaCoder Controls
2+
3+
Basic controls with standardized styles and formatting.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Button from "@components/controls/Button";
2+
import { render } from "@testing-library/react";
3+
4+
describe("Button Component", () => {
5+
test("renders", () => {
6+
const { getByRole } = render(<Button>Test Button</Button>);
7+
8+
const targetButton = getByRole("button", { name: "Test Button" });
9+
10+
expect(targetButton).toBeInTheDocument();
11+
});
12+
});

0 commit comments

Comments
 (0)