-
Notifications
You must be signed in to change notification settings - Fork 5
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
372 changed files
with
39,406 additions
and
1 deletion.
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
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,91 @@ | ||
name: frontend-pull-request | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: [main, fe-dev] | ||
paths: | ||
- "client/**" | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./client | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.15.1" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run lint | ||
run: npm run lint | ||
|
||
- name: Run test | ||
run: npm run test | ||
|
||
- name: Cypress test | ||
run: npm run dev & | ||
env: | ||
CI: true | ||
|
||
- name: Wait for the server to start | ||
run: sleep 3 | ||
|
||
- name: Run Cypress tests | ||
run: npm run cypress-run | ||
|
||
chromatic: | ||
name: Run Chromatic | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./client | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.15.1" | ||
|
||
- name: Cache dependencies | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}-v1 | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm install | ||
|
||
- name: Run Chromatic | ||
uses: chromaui/action@latest | ||
id: publish_chromatic | ||
with: | ||
workingDir: client | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
|
||
- name: Comment on PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: "π **storybook**: ${{ steps.publish_chromatic.outputs.storybookUrl }}" |
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,33 @@ | ||
name: Close Issue on PR Merge | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
close-issue: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract issue number from PR body | ||
id: extract_issue | ||
run: | | ||
# Fetch PR body | ||
PR_BODY=$(curl -s -H "Authorization: token ${{ secrets.CONFIG_SUBMODULE_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}" \ | ||
| jq -r '.body') | ||
# Extract issue number from PR body using regex (customize if needed) | ||
ISSUE_NUMBER=$(echo "$PR_BODY" | grep -oP '#\d+' | head -1 | sed 's/#//') | ||
echo "ISSUE_NUMBER=$ISSUE_NUMBER" >> $GITHUB_ENV | ||
- name: Close associated issue | ||
if: env.ISSUE_NUMBER != '' | ||
run: | | ||
echo "Closing issue #${{ env.ISSUE_NUMBER }}" | ||
curl -s -X PATCH -H "Authorization: token ${{ secrets.CONFIG_SUBMODULE_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-d '{"state": "closed"}' \ | ||
"https://api.github.com/repos/${{ github.repository }}/issues/${{ env.ISSUE_NUMBER }}" |
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 +1,3 @@ | ||
# 2024-haeng-dong | ||
# νλλμ₯λ€μ μ μ°μ κ°νΈνκ²π°νλλμ₯ | ||
|
||
![service introduce](https://github.com/user-attachments/assets/9e51f7a3-0326-4c06-8b03-65aca574c10c) |
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,17 @@ | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
node_modules | ||
dist | ||
|
||
.env.* | ||
|
||
*storybook.log | ||
.DS_Store | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin | ||
|
||
storybook-static | ||
*storybook.log |
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,2 @@ | ||
engine-strict = true | ||
legacy-peer-deps = true |
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,12 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 120, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"arrowParens": "avoid", | ||
"endOfLine": "auto", | ||
"jsxSingleQuote": false, | ||
"bracketSpacing": false, | ||
"proseWrap": "preserve" | ||
} |
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,59 @@ | ||
/** @type { import('@storybook/react-webpack5').StorybookConfig } */ | ||
import type {StorybookConfig} from '@storybook/react-webpack5'; | ||
import path from 'path'; | ||
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-webpack5-compiler-swc', | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
webpackFinal: async config => { | ||
if (config.resolve) { | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
'@apis': path.resolve(__dirname, '../src/apis/'), | ||
'@assets': path.resolve(__dirname, '../src/assets/'), | ||
'@components': path.resolve(__dirname, '../src/components/'), | ||
'@constants': path.resolve(__dirname, '../src/constants/'), | ||
'@hooks': path.resolve(__dirname, '../src/hooks/'), | ||
'@store': path.resolve(__dirname, '../src/store/'), | ||
'@mocks': path.resolve(__dirname, '../src/mocks/'), | ||
'@pages': path.resolve(__dirname, '../src/pages/'), | ||
'@utils': path.resolve(__dirname, '../src/utils/'), | ||
'@errors': path.resolve(__dirname, '../src/errors/'), | ||
'@HDesign': path.resolve(__dirname, '../src/components/Design/'), | ||
'@HDcomponents': path.resolve(__dirname, '../src/components/Design/components/'), | ||
'@HDutils': path.resolve(__dirname, '../src/components/Design/utils/'), | ||
'@token': path.resolve(__dirname, '../src/components/Design/token/'), | ||
'@theme': path.resolve(__dirname, '../src/components/Design/theme/'), | ||
'@layouts': path.resolve(__dirname, '../src/components/Design/layouts/'), | ||
'@type': path.resolve(__dirname, '../src/components/Design/type/'), | ||
}; | ||
} | ||
|
||
config.module = config.module || {}; | ||
config.module.rules = config.module.rules || []; | ||
|
||
const imageRule = config.module.rules.find(rule => rule?.['test']?.test('.svg')); | ||
if (imageRule) { | ||
imageRule['exclude'] = /\.svg$/; | ||
} | ||
|
||
config.module.rules.push({ | ||
test: /\.svg$/, | ||
use: ['@svgr/webpack'], | ||
}); | ||
return config; | ||
}, | ||
}; | ||
export default config; |
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,41 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
|
||
import type {Preview} from '@storybook/react'; | ||
import {HDesignProvider} from '../src/components/Design'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
viewport: { | ||
defaultViewport: { | ||
styles: { | ||
width: '375px', | ||
height: '812px', | ||
}, | ||
}, | ||
}, | ||
backgrounds: { | ||
default: 'gray', | ||
values: [ | ||
{ | ||
name: 'gray', | ||
value: '#f3f3f3', | ||
}, | ||
], | ||
}, | ||
}, | ||
decorators: [ | ||
Story => ( | ||
<HDesignProvider> | ||
<Story /> | ||
</HDesignProvider> | ||
), | ||
], | ||
}; | ||
|
||
export default preview; |
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,12 @@ | ||
import {defineConfig} from 'cypress'; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:3000', | ||
viewportWidth: 430, | ||
viewportHeight: 930, | ||
// setupNodeEvents(on, config) { | ||
// // implement node event listeners here | ||
// }, | ||
}, | ||
}); |
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,6 @@ | ||
const CONSTANTS = { | ||
eventName: 'ν μ€νΈ μ΄λ²€νΈ', | ||
eventPassword: '1234', | ||
}; | ||
|
||
export default CONSTANTS; |
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,79 @@ | ||
import {ROUTER_URLS} from '@constants/routerUrls'; | ||
import CONSTANTS from '../constants/constants'; | ||
import RULE from '@constants/rule'; | ||
|
||
beforeEach(() => { | ||
cy.blockSentry(); | ||
cy.blockKakao(); | ||
}); | ||
|
||
describe('Flow: λλ© νμ΄μ§μμλΆν° μ΄λ²€νΈλ₯Ό μμ± μλ£νλ flow', () => { | ||
it('λλ©νμ΄μ§μμ "μ μ° μμνκΈ°" λ²νΌμ λλ¬ νμ¬ μ΄λ¦ μ λ ₯ νμ΄μ§λ‘ μ΄λν΄μΌ νλ€.', () => { | ||
cy.visit('/'); | ||
cy.get('button').contains('μ μ° μμνκΈ°').click(); | ||
cy.url().should('include', ROUTER_URLS.createEvent); | ||
}); | ||
|
||
context('νμ¬ μ΄λ¦ μ λ ₯ νμ΄μ§', () => { | ||
beforeEach(() => { | ||
cy.visit(ROUTER_URLS.createEvent); | ||
}); | ||
|
||
it('νμ¬ μ΄λ¦ μ λ ₯ νμ΄μ§μμ inputμ΄ ν¬μ»€μ± λμ΄ μκ³ , "λ€μ" λ²νΌμ΄ λΉνμ±ν λμ΄ μμ΄μΌ νλ€.', () => { | ||
cy.get('input').focused(); | ||
cy.get('button').contains('λ€μ').should('have.attr', 'disabled'); | ||
}); | ||
|
||
it('νμ¬ μ΄λ¦μ΄ 1μ μ΄μ μ λ ₯λ κ²½μ° "λ€μ" λ²νΌμ΄ νμ±ν λκ³ , κ°μ΄ μλ κ²½μ° "λ€μ" λ²νΌμ΄ λΉνμ±ν λμ΄μΌ νλ€.', () => { | ||
cy.get('input').type(CONSTANTS.eventName); | ||
cy.get('button').contains('λ€μ').should('not.have.attr', 'disabled'); | ||
cy.get('input').clear(); | ||
cy.get('input').should('have.value', ''); | ||
cy.get('button').contains('λ€μ').should('have.attr', 'disabled'); | ||
}); | ||
|
||
it('νμ¬ μ΄λ¦μ μ λ ₯ν ν "λ€μ" λ²νΌμ λλ₯΄λ©΄ νμ¬ λΉλ°λ²νΈ μ€μ νλ©΄μΌλ‘ μ΄λν΄μΌ νλ€.', () => { | ||
cy.get('input').type(CONSTANTS.eventName); | ||
cy.get('button').contains('λ€μ').click(); | ||
|
||
// λ€μ λ²νΌμ ν΄λ¦νλ©΄ /create/event κ²½λ‘κ° μλλΌ /create/event/?λ‘ κ°λ€μ.. κ·Έλμ μΌλ¨ μ κ±°ν¨. | ||
cy.contains('λΉλ°λ²νΈ').should('exist'); | ||
}); | ||
}); | ||
|
||
context('νμ¬ λΉλ°λ²νΈ μ λ ₯ νμ΄μ§', () => { | ||
beforeEach(() => { | ||
cy.createEventName(CONSTANTS.eventName); | ||
}); | ||
|
||
it('νμ¬ λΉλ°λ²νΈ μ λ ₯ νμ΄μ§μμ inputμ΄ ν¬μ»€μ± λμ΄ μκ³ , "νλ κ°μ!" λ²νΌμ΄ λΉνμ±ν λμ΄ μμ΄μΌ νλ€.', () => { | ||
cy.get('input').focused(); | ||
cy.get('button').contains('νλ κ°μ!').should('have.attr', 'disabled'); | ||
}); | ||
|
||
it('νμ¬ λΉλ°λ²νΈμ μ«μκ° μλ μ λ ₯μ ν κ²½μ° κ°μ΄ μ λ ₯λμ§ μμμΌ νλ€.', () => { | ||
cy.get('input').type('ν μ€νΈ'); | ||
cy.get('input').should('have.value', ''); | ||
}); | ||
|
||
it(`νμ¬ λΉλ°λ²νΈμ ${RULE.maxEventPasswordLength}μ리 μ΄μ μ λ ₯μ ν κ²½μ° μ²μ ${RULE.maxEventPasswordLength}μλ¦¬λ§ μ λ ₯λμ΄μΌ νλ€.`, () => { | ||
cy.get('input').type('12345'); | ||
cy.get('input').should('have.value', CONSTANTS.eventPassword); | ||
}); | ||
|
||
it('νμ¬ λΉλ°λ²νΈμ΄ 1μ μ΄μ μ λ ₯λ κ²½μ° "νλ κ°μ!" λ²νΌμ΄ νμ±ν λκ³ , κ°μ΄ μλ κ²½μ° "νλ κ°μ!" λ²νΌμ΄ λΉνμ±ν λμ΄μΌ νλ€.', () => { | ||
cy.get('input').type(CONSTANTS.eventPassword); | ||
cy.get('button').contains('νλ κ°μ!').should('not.have.attr', 'disabled'); | ||
cy.get('input').clear(); | ||
cy.get('input').should('have.value', ''); | ||
cy.get('button').contains('νλ κ°μ!').should('have.attr', 'disabled'); | ||
}); | ||
|
||
it('νμ¬ λΉλ°λ²νΈμ μ λ ₯ν ν "νλ κ°μ!" λ²νΌμ λλ₯΄λ©΄ νμ¬ μμ± μλ£ νλ©΄μΌλ‘ μ΄λν΄μΌ νλ€.', () => { | ||
cy.interceptAPI({type: 'postEvent', statusCode: 200}); | ||
cy.interceptAPI({type: 'getEventName', statusCode: 200}); | ||
cy.get('input').type(CONSTANTS.eventPassword); | ||
cy.get('button').contains('νλ κ°μ!').click(); | ||
}); | ||
}); | ||
}); |
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,3 @@ | ||
{ | ||
"eventId": "550e8400-e29b-41d4-a716-446655440000" | ||
} |
Oops, something went wrong.