Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

충남대 FE_강병현 5주차 과제 Step2 #94

Open
wants to merge 16 commits into
base: kang-kibong
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["react-app", "eslint:recommended", "plugin:import/typescript", "airbnb", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-var": "error",
"no-multiple-empty-lines": "error",
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"eqeqeq": "error",
"dot-notation": "error",
"import/extensions": ["error", "ignorePackages", {
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}],
"react/jsx-props-no-spreading": "off",
"import/prefer-default-export": "off",
"react/jsx-filename-extension": ["error", { "extensions": [".tsx"] }],
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"react/require-default-props": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error", { "variables": false , "functions": false,"classes": false}],
"react/prop-types": "off",
"import/no-cycle": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"jsx-a11y/label-has-associated-control": [ 2, {
"some": [ "nesting", "id" ]
}],
"react-hooks/exhaustive-deps": "off",
"no-alert": "off",
"react/jsx-no-useless-fragment": "off",
"react/no-unstable-nested-components": "off",
"react/button-has-type": "off",
"react-hooks/rules-of-hooks": "off",
"no-const-assign": "off"
},
"settings": {
"import/resolver": {
"alias": {
"map": [
["@", "./src"],
["@components", "./src/components"],
["@assets", "./src/assets"],
["@hooks", "./src/hooks"],
["@pages", "./src/pages"],
["@routes", "./src/routes"],
["@utils", "./src/utils"],
["@context", "./src/context"],
["@internalTypes", "./src/types"],
["@apis", "./src/apis"],
["@mocks", "./src/mocks"]
],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}
59 changes: 0 additions & 59 deletions .eslintrc.js

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -22,4 +23,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache
.yaml

*storybook.log
1 change: 1 addition & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"singleQuote": true,
"parser": "typescript",
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 100,
"printWidth": 120,
"arrowParens": "always"
}
35 changes: 15 additions & 20 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
import type { StorybookConfig } from '@storybook/react-webpack5';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import path from 'path';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-create-react-app',
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
webpackFinal: async (config) => {
config.resolve?.plugins?.push(
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../tsconfig.json'),
}),
);

return config;
},
framework: {
name: '@storybook/react-webpack5',
options: {
builder: {
useSWC: true,
},
},
},
docs: {
autodocs: 'tag',
options: {},
},
staticDirs: ['../public'],
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: config.resolve.extensions,
}),
];
}
return config;
},
};
export default config;
2 changes: 0 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { Preview } from '@storybook/react';
import '@/styles';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
# 카카오 테크 캠퍼스 - 프론트엔드 카카오 선물하기 편
# 5️⃣ 5주차 로그인 및 관심목록 (with. 테스트코드)
## 🎯 1단계 - Form 부분 테스트 코드 작성하기
### ✅ 기능 목록
- [x] MSW를 사용하여 Mock API가 동작하도록 구현
- [x] 상품 상세 API 동작
- [x] 상품 옵션 API 동작
- [x] 단위 테스트 진행
- [x] 상품 상세페이지 통합 테스트 구현
- [x] 결제 페이지의 Form관련한 통합 테스트 코드 구현
- [x] 현금영수증 Checkbox가 false인 경우 현금영수증 종류, 현금영수증 번호 field가 비활성화 되어있는지 확인하는 테스트 코드 구현 (만약 true인 경우 현금영수증 종류, 번호 field에 값이 입력 되어야 함)
- [x] form의 validation 로직이 정상 동작하는지 확인하는 테스트 코드 구현

## 🔐 2단계 - 로그인, 관심 상품 등록 / 삭제, 관심 목록 구현
### ✅ 기능 목록
- [x] 회원가입 구현
- [x] 회원가입 기능이 동작되게 구현
- [x] 회원가입을 하면 로그인 되도록 구현
- [x] 상품 상세 페이지 관심 등록 버튼 구현
- [x] 상품 상세 페이지에서 관심 버튼을 클릭 했을 때 관심 추가 동작
- [x] 관심 등록 성공 시 Alert로 "관심 등록 완료" 메시지를 노출
- [] 나의 계정 페이지에서 관심 목록 리스트를 만들어요.
- [x] 관심 목록 리스트
- [x] 관심 목록 API는 카카오테크 선물하기 API 노션의 response 데이터를 사용하여 렌더링
- [x] 관심 삭제 기능 구현
30 changes: 29 additions & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,35 @@ const path = require('path');
module.exports = {
webpack: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@': path.resolve(__dirname, 'src/'),
'@components': path.resolve(__dirname, 'src/components'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@hooks': path.resolve(__dirname, 'src/hooks'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@routes': path.resolve(__dirname, 'src/routes'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@context': path.resolve(__dirname, 'src/context'),
'@mocks': path.resolve(__dirname, 'src/mocks'),
'@internalTypes': path.resolve(__dirname, 'src/types'),
'@apis': path.resolve(__dirname, 'src/apis'),
},
},
jest: {
configure: {
moduleNameMapper: {
'^axios$': 'axios/dist/node/axios.cjs',
'^@/(.*)$': '<rootDir>/src/$1',
'^@apis/(.*)$': '<rootDir>/src/apis/$1',
'^@assets/(.*)$': '<rootDir>/src/assets/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@context/(.*)$': '<rootDir>/src/context/$1',
'^@mocks/(.*)$': '<rootDir>/src/mocks/$1',
'^@pages/(.*)$': '<rootDir>/src/pages/$1',
'^@routes/(.*)$': '<rootDir>/src/routes/$1',
'^@types/(.*)$': '<rootDir>/src/types/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
},
},
},
};
Loading