From a9dda87d72ae59af49342bedb62c3eebdd4540bc Mon Sep 17 00:00:00 2001 From: Natania Deandra Date: Sun, 26 May 2024 11:23:47 +0700 Subject: [PATCH] [REFACTOR] removed unnecessary imports and fix issues on sonarcloud --- __tests__/event/event.test.tsx | 2 +- __tests__/rundown/create-rundown-manual.tsx | 3 --- __tests__/rundown/free-rundown-ai-button.test.tsx | 2 +- __tests__/rundown/premium-rundown-ai-button.test.tsx | 2 +- src/app/dashboard/TransactionHistory.tsx | 4 +--- src/app/dashboard/page.tsx | 2 +- .../event/[eventId]/(eventId)/rundown/CreateRundownButton.tsx | 4 ++-- .../(eventId)/task/[taskId]/step/AddTaskStepsButton.tsx | 2 +- src/app/plans/AISuggestion/AIButton.tsx | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/__tests__/event/event.test.tsx b/__tests__/event/event.test.tsx index ac92c86..18192fa 100644 --- a/__tests__/event/event.test.tsx +++ b/__tests__/event/event.test.tsx @@ -355,7 +355,7 @@ describe('Test for event page', () => { fireEvent.submit(getByTestId('purpose-form')) }) - + it('test if createEvetData is null', async () => { const myInitialState = dayjs('2022-12-12') diff --git a/__tests__/rundown/create-rundown-manual.tsx b/__tests__/rundown/create-rundown-manual.tsx index 44b9b6a..a91ecbe 100644 --- a/__tests__/rundown/create-rundown-manual.tsx +++ b/__tests__/rundown/create-rundown-manual.tsx @@ -1,10 +1,8 @@ import '@testing-library/jest-dom' import React from 'react' import { render, fireEvent, waitFor } from '@testing-library/react' - import { Provider } from 'react-redux' import { store } from '@/redux/store' - import { useCreateRundownManuallyMutation, useCreateRundownWithAIMutation, @@ -13,7 +11,6 @@ import { useGetEventRundownQuery, } from '@/redux/api/rundownApi' import { toast } from 'react-hot-toast' - import { redirect, useParams, usePathname } from 'next/navigation' import { CreateRundownManualForm } from '@/app/event/[eventId]/(eventId)/rundown/CreateRundownManualForm' import CreateRundownPage from '@/app/event/[eventId]/(eventId)/create-rundown/page' diff --git a/__tests__/rundown/free-rundown-ai-button.test.tsx b/__tests__/rundown/free-rundown-ai-button.test.tsx index 9b8b1aa..dc65dac 100644 --- a/__tests__/rundown/free-rundown-ai-button.test.tsx +++ b/__tests__/rundown/free-rundown-ai-button.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react' import '@testing-library/jest-dom' import { Provider as ReduxProvider } from 'react-redux' import { store } from '@/redux/store' -import { redirect, useParams, usePathname } from 'next/navigation' +import { useParams } from 'next/navigation' import { CreateRundownButton } from '@/app/event/[eventId]/(eventId)/rundown/CreateRundownButton' jest.mock('next/navigation', () => ({ diff --git a/__tests__/rundown/premium-rundown-ai-button.test.tsx b/__tests__/rundown/premium-rundown-ai-button.test.tsx index d692bf6..f835b51 100644 --- a/__tests__/rundown/premium-rundown-ai-button.test.tsx +++ b/__tests__/rundown/premium-rundown-ai-button.test.tsx @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react' import '@testing-library/jest-dom' import { Provider as ReduxProvider } from 'react-redux' import { store } from '@/redux/store' -import { redirect, useParams, usePathname } from 'next/navigation' +import { useParams } from 'next/navigation' import { CreateRundownButton } from '@/app/event/[eventId]/(eventId)/rundown/CreateRundownButton' jest.mock('next/navigation', () => ({ diff --git a/src/app/dashboard/TransactionHistory.tsx b/src/app/dashboard/TransactionHistory.tsx index f64c6ce..e94c0ad 100644 --- a/src/app/dashboard/TransactionHistory.tsx +++ b/src/app/dashboard/TransactionHistory.tsx @@ -74,9 +74,7 @@ export const TransactionHistory = ({ status }: TransactionHistoryI) => { {formatDateTime(checkout_time)} - - {name} - + {name} {formatRupiah(price)} diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 98623ca..fe33e88 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -237,7 +237,7 @@ export default function Profile() { )) ) : ( -

No events found.

+

No events found.

)} ) : ( diff --git a/src/app/event/[eventId]/(eventId)/rundown/CreateRundownButton.tsx b/src/app/event/[eventId]/(eventId)/rundown/CreateRundownButton.tsx index 4de205b..0d1fcf8 100644 --- a/src/app/event/[eventId]/(eventId)/rundown/CreateRundownButton.tsx +++ b/src/app/event/[eventId]/(eventId)/rundown/CreateRundownButton.tsx @@ -56,9 +56,9 @@ export const CreateRundownButton = () => { data-testid="free-rundown-ai-button" style={{ backgroundColor: 'gray', color: 'white' }} > -

+

- Generate with AI + Generate with AI

)} diff --git a/src/app/event/[eventId]/(eventId)/task/[taskId]/step/AddTaskStepsButton.tsx b/src/app/event/[eventId]/(eventId)/task/[taskId]/step/AddTaskStepsButton.tsx index ebd2e40..b581cf3 100644 --- a/src/app/event/[eventId]/(eventId)/task/[taskId]/step/AddTaskStepsButton.tsx +++ b/src/app/event/[eventId]/(eventId)/task/[taskId]/step/AddTaskStepsButton.tsx @@ -52,7 +52,7 @@ export const AddTaskStepsButton = () => { >

- Generate with AI + Generate with AI

)} diff --git a/src/app/plans/AISuggestion/AIButton.tsx b/src/app/plans/AISuggestion/AIButton.tsx index d091c3f..3e15db7 100644 --- a/src/app/plans/AISuggestion/AIButton.tsx +++ b/src/app/plans/AISuggestion/AIButton.tsx @@ -32,7 +32,7 @@ export const AIButton = () => { >

- Ask AI + Ask AI

)}