diff --git a/.gitignore b/.gitignore
index 9876f894..397eb575 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,8 @@ yarn-debug.log*
yarn-error.log*
/k8s/secret.yaml
+/test-results/
+/playwright-report/
+/playwright/
/tests/tests-examples/
-/tests/tests-results/
-/tests/playwright-report/
-/playwright/.cache/
+/tests/logintest.ts
\ No newline at end of file
diff --git a/playwright.config.ts b/playwright.config.ts
index 301801ee..fa8072fb 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -1,15 +1,15 @@
import { defineConfig, devices } from '@playwright/test';
+import path from 'path';
+require('dotenv').config();
-/**
- * Read environment variables from file.
- * https://github.com/motdotla/dotenv
- */
-// require('dotenv').config();
-
+export const ADMINSTATE = path.join(__dirname, './playwright/.auth/admin.json');
+export const ALBASTATE = path.join(__dirname, './playwright/.auth/alba.json');
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
+ // globalSetup: require.resolve('./tests/globalSetup.ts'),
+
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
@@ -24,39 +24,74 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
- // baseURL: 'http://127.0.0.1:3000',
+ baseURL: `${process.env.REACT_APP_BASE_URL}`,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
-
+ timeout: 10000,
/* Configure projects for major browsers */
projects: [
+ // {
+ // name: 'setup',
+ // testMatch: /globalAdmin.setup\.ts/,
+ // use: { storageState: ADMINSTATE },
+ // },
+ // {
+ // name: 'setupAlba',
+ // testMatch: /globalAlba.setup\.ts/,
+ // use: { storageState: ALBASTATE },
+ // },
{
- name: 'chromium',
- use: { ...devices['Desktop Chrome'] },
+ name: 'admin',
+ // dependencies: ['setup'],
+ use: {
+ ...devices['Desktop Chrome'],
+ storageState: ADMINSTATE,
+ },
+ testMatch: '**/tests/admin/**',
+ testIgnore: '**/tests/alba/**',
},
-
{
- name: 'firefox',
- use: { ...devices['Desktop Firefox'] },
+ name: 'alba',
+ // dependencies: ['setupAlba'],
+ use: {
+ ...devices['Desktop Chrome'],
+ storageState: ALBASTATE,
+ },
+ testMatch: '**/tests/alba/**',
+ testIgnore: '**/tests/admin/**',
},
-
{
- name: 'webkit',
- use: { ...devices['Desktop Safari'] },
+ name: 'logout',
+ use: { ...devices['Desktop Chrome'] },
+ testMatch: /login.spec\.ts/,
},
+ // {
+ // name: 'chromium',
+ // use: { ...devices['Desktop Chrome'] },
+ // },
- /* Test against mobile viewports. */
// {
- // name: 'Mobile Chrome',
- // use: { ...devices['Pixel 5'] },
+ // name: 'firefox',
+ // use: { ...devices['Desktop Firefox'] },
// },
+
// {
- // name: 'Mobile Safari',
- // use: { ...devices['iPhone 12'] },
+ // name: 'webkit',
+ // use: { ...devices['Desktop Safari'] },
// },
+ /* Test against mobile viewports. */
+ {
+ name: 'Mobile Chrome',
+ use: { ...devices['Pixel 5'] },
+ },
+ {
+ name: 'Mobile Safari',
+ use: { ...devices['iPhone 12'] },
+ },
+
/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
diff --git a/src/App.tsx b/src/App.tsx
index 90b7b01e..67bbbc37 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,8 +1,7 @@
-import { QueryCache, QueryClient, QueryClientProvider, useQueryErrorResetBoundary } from '@tanstack/react-query';
+import { QueryClientProvider, useQueryErrorResetBoundary } from '@tanstack/react-query';
import { convertPath } from 'apis/convertURI';
import ViewPortContainer from 'components/@commons/ViewPortContainer';
import ErrorFallback from 'error/ErrorFallback';
-import { defaultErrorHandler } from 'error/defaultErrorHandler';
import { Provider } from 'jotai';
import HomeIndex from 'pages/HomeIndex';
import KakaoAuthPage from 'pages/KakaoAuthPage';
@@ -19,27 +18,7 @@ import { ErrorBoundary } from 'react-error-boundary';
import { Route, Routes } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
import { myTheme } from 'styles/myTheme';
-
-const queryClient = new QueryClient({
- queryCache: new QueryCache({
- onError(error, query) {
- defaultErrorHandler(error || { name: 'unknownError' });
- setTimeout(() => {
- queryClient.removeQueries(query.queryKey);
- }, 1000);
- },
- }),
- defaultOptions: {
- queries: {
- useErrorBoundary: true,
- retry: 0,
- refetchOnWindowFocus: false,
- },
- mutations: {
- onError: (err) => defaultErrorHandler(err || { name: 'unknownError' }),
- },
- },
-});
+import { queryClient } from 'utils/queryClient';
function App(): JSX.Element {
const { reset } = useQueryErrorResetBoundary();
diff --git a/src/components/Calendar/CalenderOutter.tsx b/src/components/Calendar/CalenderOutter.tsx
index 2f235e5a..b139acf1 100644
--- a/src/components/Calendar/CalenderOutter.tsx
+++ b/src/components/Calendar/CalenderOutter.tsx
@@ -1,59 +1,63 @@
import FlexContainer from 'components/@commons/FlexContainer';
import Text from 'components/@commons/Text';
import { NextButton, PrevButton } from 'components/@commons/icons/buttons';
-import { PrimitiveAtom, useAtom } from 'jotai';
-import React from 'react';
-import { WeekGrid } from './CalendarStyle';
import weekdayArray from 'utils/weekdayArray';
+import { WeekGrid } from './CalendarStyle';
-interface Props {
- monthDataAtom: PrimitiveAtom<{
- year: number;
- month: number;
- }>;
-}
+const CalenderOutter = ({ selectedMonth, setMonth }: Props): JSX.Element => {
+ return (
+
+
+
+
+ );
+};
-const CalenderOutter = ({ monthDataAtom }: Props): JSX.Element => {
- const [nowMonth, setNowMonth] = useAtom(monthDataAtom);
- const { year, month } = nowMonth;
+export default CalenderOutter;
+const MonthSelectBar = ({ selectedMonth, setMonth }: Props) => {
+ const { year, month } = selectedMonth;
const monthMoveHandler = (dm: number) => {
- const newDateObj = new Date(nowMonth.year, nowMonth.month + dm, 1);
- const newObj = { year: newDateObj.getFullYear(), month: newDateObj.getMonth() };
- setNowMonth(newObj);
+ const newDateObj = new Date(year, month + dm, 1);
+ setMonth({ year: newDateObj.getFullYear(), month: newDateObj.getMonth() });
};
return (
-
-
- monthMoveHandler(-1)} />
+
+ monthMoveHandler(-1)} />
-
- {`${year} 년`}
- {`${month + 1} 월`}
-
-
- monthMoveHandler(+1)} />
-
-
-
+
+ {`${year} 년`}
+ {`${month + 1} 월`}
+
+ monthMoveHandler(+1)} />
);
};
-export default CalenderOutter;
-
const DayTitle = () => {
return (
-
- {weekdayArray.map((e) => (
-
-
- {e.eng}
-
-
- ))}
-
+
+
+ {weekdayArray.map((e) => (
+
+
+ {e.eng}
+
+
+ ))}
+
+
);
};
+
+export interface MonthData {
+ year: number;
+ month: number;
+}
+
+interface Props {
+ selectedMonth: MonthData;
+ setMonth: (monthdata: MonthData) => void;
+}
diff --git a/src/components/Suspenses/DefferedSuspense.tsx b/src/components/Suspenses/DefferedSuspense.tsx
index cbb51d42..01c4725a 100644
--- a/src/components/Suspenses/DefferedSuspense.tsx
+++ b/src/components/Suspenses/DefferedSuspense.tsx
@@ -1,12 +1,13 @@
-import React, { PropsWithChildren, useEffect, useState } from 'react';
+import React, { useEffect, useState } from 'react';
-const DefferedSuspense = ({ children }: PropsWithChildren<{}>) => {
+const DefferedSuspense = ({ children, deffered = true }: { children: React.ReactNode; deffered?: boolean }) => {
const [isDeferred, setIsDeferred] = useState(false);
+ const time = deffered ? 200 : 0;
useEffect(() => {
const timeout = setTimeout(() => {
setIsDeferred(true);
- }, 200);
+ }, time);
return () => clearTimeout(timeout);
}, []);
diff --git a/src/components/Suspenses/Loader.tsx b/src/components/Suspenses/Loader.tsx
index fe6aba2d..00f5f3ba 100644
--- a/src/components/Suspenses/Loader.tsx
+++ b/src/components/Suspenses/Loader.tsx
@@ -1,16 +1,9 @@
-import React from 'react';
import { styled } from 'styled-components';
import DefferedSuspense from './DefferedSuspense';
-const StyledLoader = styled.div<{ $size?: string }>`
- margin: auto;
- width: ${(props) => (props.$size ? props.$size : '40px')};
- height: ${(props) => (props.$size ? props.$size : '40px')};
-`;
-
-const Loader = ({ size }: { size?: string }) => {
+const Loader = ({ size, isDeffered = true }: { size?: string; isDeffered?: boolean }) => {
return (
-
+