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

[RM - 36]common 컴포넌트 병합 로그인,회원가입 페이지 생성 #62

Merged
merged 4 commits into from
Apr 29, 2024
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
Binary file modified .yarn/install-state.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion __tests__/unit/HomePage/Page.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("HomePage 테스트", () => {
// 첫 번째 버튼 클릭
const firstButton = screen.getByTestId("firstButton");
fireEvent.click(firstButton);
expect(pushMock).toHaveBeenCalledWith("/login");
expect(pushMock).toHaveBeenCalledWith("/editor");

// 두 번째 버튼 클릭
const secondButton = screen.getByTestId("secondButton");
Expand Down
19 changes: 19 additions & 0 deletions __tests__/unit/LoginPage/Page.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { fireEvent, render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { MemoryRouter } from "react-router-dom";
import React from "react";
import "@testing-library/jest-dom";

import LoginPage from "../../../src/pages/LoginPage";

describe("LoginPage 테스트", () => {
test("LoginPage 정상적으로 렌더링되어야 함", () => {
render(
<MemoryRouter initialEntries={["/"]}>
<LoginPage />
</MemoryRouter>,
);

expect(screen.getByTestId("login")).toBeInTheDocument();
});
});
19 changes: 19 additions & 0 deletions __tests__/unit/SignupPage/Page.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { fireEvent, render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { MemoryRouter } from "react-router-dom";
import React from "react";
import "@testing-library/jest-dom";

import SignupPage from "../../../src/pages/SignupPage";

describe("LoginPage 테스트", () => {
test("LoginPage 정상적으로 렌더링되어야 함", () => {
render(
<MemoryRouter initialEntries={["/"]}>
<SignupPage />
</MemoryRouter>,
);

expect(screen.getByTestId("signup")).toBeInTheDocument();
});
});
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Editor/SectionsContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tab, Tabs } from "components/Common/Tabs";
import { Tab, Tabs } from "../../components/Common/Tabs";
import React, { useState } from "react";
import Auto from "./Components/Auto";
import Builder from "./Components/Builder";
Expand Down
2 changes: 1 addition & 1 deletion src/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Outlet } from "react-router-dom";
import Header from "../common/Header/Header";
import Header from "../components/Common/Header/Header";

const AppLayout = () => {
return (
Expand Down
7 changes: 7 additions & 0 deletions src/pages/LoginPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const LoginPage = () => {
return <div data-testid="login">로그인페이지</div>;
};

export default LoginPage;
4 changes: 4 additions & 0 deletions src/pages/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import HomePage from "./HomePage";
import NotFoundPage from "./NotFoundPage/NotFoundPage";
import ReadmeBuilder from "./builder/ReadmeBuilder";
import MyPage from "./myPage";
import LoginPage from "./LoginPage";
import SignupPage from "./SignupPage";

export const Routes = () => {
return (
<ReactRouterRoutes>
<Route path="/" element={<AppLayout />}>
<Route index element={<HomePage />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/signup" element={<SignupPage />} />
<Route path="editor" element={<ReadmeBuilder />} />
<Route path="myPage" element={<MyPage />} />
</Route>
Expand Down
6 changes: 6 additions & 0 deletions src/pages/SignupPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";
function SignupPage() {
return <div data-testid="signup">회원가입페이지</div>;
}

export default SignupPage;
1 change: 0 additions & 1 deletion src/pages/builder/ReadmeBuilder.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Header from "common/Header/Header";
import React from "react";
import EditorPreviewContainer from "../../components/Editor/EditorPreviewContainer";
import SectionsContainer from "../../components/Editor/SectionsContainer";
Expand Down
4 changes: 2 additions & 2 deletions src/pages/myPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UserInfo from "components/MyPage/UserInfo";
import UserPreviousList from "components/MyPage/UserPrevious";
import UserInfo from "../../components/MyPage/UserInfo";
import UserPreviousList from "../../components/MyPage/UserPrevious";
import React, { ChangeEvent, MouseEvent, useState } from "react";
import { TabStateProps, UserInfoProps } from "./types";

Expand Down
Loading