-
delete
-
{title}
-
{subtitle}
-
-
setIsShown((prev) => !prev)}>{cancel}
+
+
);
};
diff --git a/src/components/SettingsPageComp/ConfirmOverlay.tsx b/src/components/SettingsPageComp/ConfirmOverlay.tsx
deleted file mode 100644
index fd30fcb..0000000
--- a/src/components/SettingsPageComp/ConfirmOverlay.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Dispatch, KeyboardEvent, MouseEvent, ReactNode, SetStateAction } from 'react';
-
-type PropsType = {
- setIsShown: Dispatch
>;
- isShown: boolean;
- children: ReactNode;
-};
-
-const ConfirmOverlay = ({ isShown, setIsShown, children }: PropsType) => {
- function closeHandler(e: MouseEvent | KeyboardEvent) {
- if ((e.target as HTMLButtonElement).hasAttribute('data-overlay')) {
- setIsShown((prev) => !prev);
- }
- }
- if (!isShown) {
- return null;
- }
- return (
- closeHandler(e)}
- onKeyDown={(e) => closeHandler(e)}
- className="overlay absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center bg-black/60"
- >
- {children}
-
- );
-};
-
-export default ConfirmOverlay;
diff --git a/src/components/loginReg/FormInput.tsx b/src/components/loginReg/FormInput.tsx
deleted file mode 100644
index cb9da3d..0000000
--- a/src/components/loginReg/FormInput.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { FC, HTMLAttributes } from 'react';
-
-import { TextInputProps } from '@shared/types';
-import OutlinedTextField from '@shared/ui/OutlinedTextField';
-
-type FormInputProps = HTMLAttributes & TextInputProps;
-
-const FormInput: FC = ({ ...props }) => {
- return ;
-};
-
-export default FormInput;
diff --git a/src/layouts/MainLayout.tsx b/src/layouts/MainLayout.tsx
index b95892e..937242d 100644
--- a/src/layouts/MainLayout.tsx
+++ b/src/layouts/MainLayout.tsx
@@ -6,6 +6,7 @@ import Header from '@components/Header/Header';
import Nav from '@components/Nav/Nav';
import Controls from '@components/RequestEditor/ui/Controls';
import ViewProvider from '@components/ViewList/context/ViewProvider';
+import { SNACKBAR_AUTO_HIDE_DURATION } from '@shared/constants/const';
import useScrollbar from '@shared/lib/hooks/useScrollbar';
const SnackBarTransition = cssTransition({
@@ -39,7 +40,7 @@ const MainLayout = () => {
{
expect(await screen.findByText('Dark mode')).toBeInTheDocument();
expect(await screen.findByText('Clear storage')).toBeInTheDocument();
});
- it('Should opened modal and close it with proper buttons', async () => {
- render();
- const clearDataBtn = screen.getByText('Clear data');
- expect(screen.queryByTestId('overlay')).toBeNull();
- await act(async () => {
- fireEvent.click(clearDataBtn);
- });
- expect(await screen.findByTestId('overlay')).toBeInTheDocument();
- const closeBtn = await screen.findByText('Cancel');
- await act(async () => {
- fireEvent.click(closeBtn);
- });
- waitForElementToBeRemoved(() => {
- expect(screen.queryByTestId('overlay')).toBeNull();
- }).catch(() => {});
- });
- it('Should open confirm modal and close it after clicking corresponding buttons', async () => {
- render();
- const clearDataBtn = screen.getByText('Clear data');
- await act(async () => {
- fireEvent.click(clearDataBtn);
- });
- const clearBtn = await screen.findByText('Clear');
- await act(async () => {
- fireEvent.click(clearBtn);
- });
- const undoBtn = await screen.findByText('Undo');
- await act(async () => {
- fireEvent.click(undoBtn);
- });
- waitForElementToBeRemoved(() => {
- expect(undoBtn).toBeNull();
- }).catch(() => {});
- });
it('Should change color theme after clicking on theme switcher', async () => {
render();
expect(document.body.getAttribute('data-user-theme')).toBeNull();