Skip to content
Merged
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
14 changes: 14 additions & 0 deletions fixtures/study-group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const studyGroup = {
id: 1,
moderatorId: 'user1',
title: '스터디를 소개합니다. 1',
personnel: 7,
contents: '우리는 이것저것 합니다.1',
tags: [
'JavaScript',
'React',
'Algorithm',
],
};

export default studyGroup;
263 changes: 263 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@types/jest": "^26.0.15",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.1",
"css-loader": "^5.0.1",
"eslint": "^7.13.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
Expand All @@ -56,7 +57,9 @@
"jest-plugin-context": "^2.9.0",
"json-server": "^0.16.3",
"redux-mock-store": "^1.5.4",
"sass-loader": "^10.1.0",
"start-server-and-test": "^1.11.5",
"style-loader": "^2.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"
Expand Down
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const App = () => (
<HeaderContainer />
<Switch>
<Route exact path="/" component={MainPage} />
<Route path="/introduce" component={IntroducePage} />
<Route path="/introduce/:id" component={IntroducePage} />
</Switch>
</>
);
Expand Down
4 changes: 3 additions & 1 deletion src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MemoryRouter } from 'react-router-dom';
import { render } from '@testing-library/react';

import App from './App';
import STUDY_GROUP from '../fixtures/study-group';

jest.mock('react-redux');

Expand All @@ -20,6 +21,7 @@ describe('App', () => {

useSelector.mockImplementation((selector) => selector({
groups: [],
group: STUDY_GROUP,
}));
});

Expand All @@ -39,7 +41,7 @@ describe('App', () => {

context('with path /introduce', () => {
it('renders the study introduce page', () => {
const { container } = renderApp({ path: '/introduce' });
const { container } = renderApp({ path: '/introduce/1' });

expect(container).toHaveTextContent('스터디 소개');
});
Expand Down
Loading