Skip to content

Commit

Permalink
feat: add color inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGarrixen committed Dec 21, 2023
1 parent 78e8c01 commit 2e08567
Show file tree
Hide file tree
Showing 32 changed files with 1,204 additions and 22 deletions.
6 changes: 6 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
import "@testing-library/jest-dom";

global.ResizeObserver = jest.fn(() => ({
observe: jest.fn(),
disconnect: jest.fn(),
unobserve: jest.fn(),
}));
192 changes: 171 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"build:icons": "npx @svgr/cli --config-file .svgrrc src/svgs"
},
"dependencies": {
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-slider": "^1.1.2",
"color": "^4.2.3",
"next": "14.0.3",
Expand Down
8 changes: 7 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ContrastResults } from "@/components/contrast-results";
import { ColorInputs } from "@/components/color-inputs";

export default function Home() {
return <ContrastResults />;
return (
<>
<ContrastResults />
<ColorInputs />
</>
);
}
19 changes: 19 additions & 0 deletions src/components/color-inputs/__tests__/panel.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { describe, it } from "@jest/globals";
import { render } from "@testing-library/react";

import { Panel } from "../panel";

describe("Color Panel", () => {
it("Correct rendering and unmount", () => {
const screen = render(<Panel label="Background" />);

expect(() => screen.unmount()).not.toThrow();
});

it("Should show label and children properties", () => {
const screen = render(<Panel label="Background">Content</Panel>);

expect(screen.getByText("Content")).toBeInTheDocument();
expect(screen.getByText("Background")).toBeInTheDocument();
});
});
Loading

0 comments on commit 2e08567

Please sign in to comment.