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

136 front task 설정 페이지 구현 #143

Merged
merged 23 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ce32dd6
issue #136 feat: Add setting tab, withdrawlal tab
2Junsu Sep 19, 2023
1404016
issue #136 update: Change setting tab to profile tab
2Junsu Sep 19, 2023
f5888e9
issue #136 feat: Feat profile image upload
2Junsu Sep 26, 2023
6adae53
issue #136 fix: Fix profile img upload errror
2Junsu Sep 26, 2023
b4eec57
issue #136 refactor: conflict resolve
sikkzz Nov 25, 2023
fb23b92
issue #136 update: Update withdraw function
2Junsu Oct 2, 2023
943ab7a
issue #136 feat: Feat user introduction message
2Junsu Oct 8, 2023
0eb9506
issue #136 feat: Feat group owner delegate, group delete
2Junsu Oct 25, 2023
8cba4d0
issue #136 feat: Feat group leave
2Junsu Oct 25, 2023
b324741
issue #136 update: Change withdrawal process
2Junsu Oct 25, 2023
2838737
issue #136 update: Change modal props
2Junsu Oct 25, 2023
7fc2671
issue #136 feat: Feat group toggle option change
2Junsu Oct 25, 2023
539e76e
issue #136 update: Delete mock group member data
2Junsu Oct 25, 2023
951e7eb
issue #136 update: update notification toggle
2Junsu Oct 26, 2023
ddb3103
issue #136 refactor: conflict resolve
sikkzz Nov 25, 2023
b28b39e
issue #136 refactor: Apply code review
2Junsu Nov 6, 2023
90e422a
issue #136 refactor: conflict resolve
sikkzz Nov 25, 2023
c48c64e
issue #136 update: RUpdate code
2Junsu Nov 16, 2023
84da721
issue #136 refactor: Refactor group service with commonThunk
2Junsu Nov 16, 2023
669b91f
issue #136 refactor: use unwrap
2Junsu Nov 16, 2023
6ab27bf
issue #136 style: Rename refetchUserGroup to isUserGroupRefetching
2Junsu Nov 16, 2023
0abfa2b
issue #136 update: Scroll to top when tab is changed, design: Change…
2Junsu Nov 16, 2023
e81d410
issue #136 refactor: conflict resolve
sikkzz Nov 25, 2023
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
68 changes: 35 additions & 33 deletions __test__/pagesTest/SettingPage.test.jsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
import React from "react";
import { Provider } from "react-redux";

import configureStore from "redux-mock-store";

import { render } from "../../jest.setup";
import SettingPage from "../../src/pages/SettingPage/SettingPage";

const mockStore = configureStore([]);

describe("SettingPage Component", () => {
let store;

beforeEach(() => {
store = mockStore({
auth: {
user: {
nickname: "test",
email: "test@test.com",
imageUrl: "",
it("renders without crashing", () => {
render(<SettingPage />, {
preloadedState: {
auth: {
user: {
nickname: "test",
email: "test@test.com",
imageUrl: "",
},
},
ui: {
openedModal: "",
},
group: {
groupInfo: { groupId: 1, name: "testGroup" },
},
},
ui: {
openedModal: "",
},
});
});

it("renders without crashing", () => {
render(
<Provider store={store}>
<SettingPage />
</Provider>,
);
});

it("renders all the tabs", () => {
const { getByText } = render(
<Provider store={store}>
<SettingPage />
</Provider>,
);
const { getByRole } = render(<SettingPage />, {
preloadedState: {
auth: {
user: {
nickname: "test",
email: "test@test.com",
imageUrl: "",
},
},
ui: {
openedModal: "",
},
group: {
groupInfo: { groupId: 1, name: "testGroup" },
},
},
});

expect(getByText("프로필 및 계정 관리")).toBeInTheDocument();
expect(getByText("공유일정 및 채팅관리")).toBeInTheDocument();
expect(getByText("비밀번호 변경")).toBeInTheDocument();
expect(getByRole("tab", { name: "profileTab" })).toBeInTheDocument();
expect(getByRole("tab", { name: "passwordTab" })).toBeInTheDocument();
expect(getByRole("tab", { name: "withdrawalTab" })).toBeInTheDocument();
});
});
14 changes: 10 additions & 4 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ import { render as rtlRender } from "@testing-library/react";
import { ThemeProvider } from "styled-components";

import { server } from "./__test__/__mocks__/msw/server.js";
import { store } from "./src/store/index.js";
import { setupStore } from "./src/store/index.js";
import lightTheme from "./src/styles/theme.js";

beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());

const render = (ui, { ...options } = {}) => {
export const render = (
ui,
{
preloadedState = {},
store = setupStore(preloadedState),
...renderOptions
} = {},
) => {
const Wrapper = ({ children }) => (
<GoogleOAuthProvider clientId="379597382111-vo2ht0r8a3d0ais7v12q7777lu48al1a.apps.googleusercontent.com">
<Provider store={store}>
Expand All @@ -25,8 +32,7 @@ const render = (ui, { ...options } = {}) => {
</Provider>
</GoogleOAuthProvider>
);
return rtlRender(ui, { wrapper: Wrapper, ...options });
return { store, ...rtlRender(ui, { wrapper: Wrapper, ...renderOptions }) };
};

export * from "@testing-library/react";
export { render };
111 changes: 59 additions & 52 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"axios": "^1.4.0",
"cross-env": "7.0.3",
"dotenv": "16.3.1",
"eslint": "8.49.0",
"eslint-plugin-import": "2.28.0",
"framer-motion": "^10.12.14",
"jest-transform-stub": "2.0.0",
Expand Down Expand Up @@ -63,7 +64,6 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"eslint": "^8.41.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
Loading