Skip to content

Commit d375a5f

Browse files
authored
Merge pull request #1 from natebass/initialize-component-tests
* Initialize component tests. * Release version 1.0.0-alpha.1
2 parents 6403dac + 64237ce commit d375a5f

File tree

130 files changed

+4054
-5652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4054
-5652
lines changed

.github/workflows/deploy-gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# To get started with Next.js see: https://nextjs.org/docs/getting-started
44
#
5-
name: Deploy Next.js static site to GitHub Pages
5+
name: Deploy Storybook Next.js static site to GitHub Pages
66

77
on:
88
# Runs on pushes targeting the default branch
@@ -81,7 +81,7 @@ jobs:
8181
- name: Install dependencies
8282
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
8383

84-
- name: Build with Next.js
84+
- name: Build with Storybook
8585
env:
8686
GITHUB_ACTIONS: true
8787
GITHUB_REPOSITORY: ${{ github.repository }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ $RECYCLE.BIN/
615615
### macOS template
616616
# General
617617

618-
# Icon must end with two \r
619-
Icon
618+
# Ignore the Icon file
619+
*/Icon
620620

621621
# Thumbnails
622622

.storybook/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
/** @type { import('@storybook/nextjs-vite').StorybookConfig } */
22
const config = {
3-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
3+
stories: [
4+
"../src/stories/**/*.mdx",
5+
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)",
6+
],
47
addons: [
58
"@chromatic-com/storybook",
69
"@storybook/addon-docs",
710
"@storybook/addon-a11y",
811
"@storybook/addon-vitest",
912
],
13+
docs: {
14+
autodocs: true,
15+
},
1016
framework: {
1117
name: "@storybook/nextjs-vite",
1218
options: {},

.storybook/preview.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1+
import "../src/app/global.css";
2+
13
/** @type { import('@storybook/nextjs-vite').Preview } */
24
const preview = {
35
parameters: {
6+
options: {
7+
storySort: {
8+
order: ['Introduction', 'Get Started', '*'],
9+
},
10+
},
411
controls: {
12+
sort: 'alpha', // or 'requiredFirst', or 'none'
513
matchers: {
614
color: /(background|color)$/i,
715
date: /Date$/i,
816
},
917
},
10-
1118
a11y: {
12-
// 'todo' - show a11y violations in the test UI only
13-
// 'error' - fail CI on a11y violations
14-
// 'off' - skip a11y checks entirely
1519
test: "todo",
1620
},
1721
},
1822
};
1923

20-
export default preview;
24+
export default preview;

.storybook/vitest.setup.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
22
import { setProjectAnnotations } from "@storybook/nextjs-vite";
33
import * as projectAnnotations from "./preview";
44

5-
// This is an important step to apply the right configuration when testing your stories.
6-
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
75
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Open Fresno Storybook (Next.js)
2+
3+
This repository hosts the **Storybook + Next.js testing environment** for Open Fresno. It provides a sandbox for building, documenting, and testing UI components in isolation before they are integrated into the main site.
4+
5+
## 🚀 Getting Started
6+
7+
### Prerequisites
8+
9+
- Node.js
10+
11+
### Installation
12+
13+
Clone the repo and install dependencies:
14+
15+
```
16+
git clone [https://github.com/openfresno/fe-openfresno-doc.git](https://github.com/openfresno/fe-openfresno-doc.git)
17+
cd fe-openfresno-doc
18+
npm install
19+
```
20+
21+
### Running Storybook
22+
23+
Start the Storybook development server:
24+
25+
```
26+
npm run storybook
27+
# or
28+
yarn storybook
29+
```
30+
31+
Storybook will be available at **http://localhost:6006**.
32+
33+
### Running Next.js
34+
35+
If you want to preview components inside a Next.js app shell:
36+
37+
```
38+
npm run dev
39+
```
40+
41+
## Testing
42+
43+
This repo is designed for component-driven development. We use:
44+
45+
- **Storybook** for isolated UI development
46+
- **Jest + React Testing Library** for unit tests
47+
- **Playwright** (optional) for visual regression and interaction tests
48+
49+
Run tests with:
50+
51+
```
52+
npm test
53+
```
54+
55+
## Contribute
56+
57+
We welcome contributions! Here are a few ways to help:
58+
59+
1. Look for Issues tagged `help wanted` or `good first issue`.
60+
2. Add or improve component stories to increase coverage.
61+
3. Write tests for new components or edge cases.
62+
4. Submit a pull request with clear commit messages.
63+
64+
## Resources
65+
66+
- [Storybook Docs](https://storybook.js.org/docs/ "null")
67+
- [Next.js Docs](https://nextjs.org/docs "null")
68+
- [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/ "null")
69+
- [Code of Conduct](https://www.google.com/search?q=https://github.com/openfresno/fe-openfresno-doc/blob/main/CODE_OF_CONDUCT.md "null")
File renamed without changes.
File renamed without changes.

src/app/(home)/-home-numbered/HomeNumbered.jsx renamed to __tests__/old_tests/old_components/-home-numbered/HomeNumbered.jsx

File renamed without changes.

0 commit comments

Comments
 (0)