From f75ced16cd4250a61eaf0520db400760d1a7c619 Mon Sep 17 00:00:00 2001 From: yashb196 <113057400+yashb196@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:41:45 -0500 Subject: [PATCH] changing naming convention to small case --- ...onent.test.tsx => note_component.test.tsx} | 2 +- ...searchBar.test.tsx => search_bar.test.tsx} | 0 .../{noteComponent.tsx => note_component.tsx} | 0 app/lib/components/searchBar.tsx | 46 ------------------- app/page.tsx | 2 +- package.json | 1 + 6 files changed, 3 insertions(+), 48 deletions(-) rename app/__tests__/{noteComponent.test.tsx => note_component.test.tsx} (95%) rename app/__tests__/{searchBar.test.tsx => search_bar.test.tsx} (100%) rename app/lib/components/{noteComponent.tsx => note_component.tsx} (100%) delete mode 100644 app/lib/components/searchBar.tsx diff --git a/app/__tests__/noteComponent.test.tsx b/app/__tests__/note_component.test.tsx similarity index 95% rename from app/__tests__/noteComponent.test.tsx rename to app/__tests__/note_component.test.tsx index 2cdd1771..b3412230 100644 --- a/app/__tests__/noteComponent.test.tsx +++ b/app/__tests__/note_component.test.tsx @@ -1,7 +1,7 @@ import Layout from "../layout"; import "@testing-library/jest-dom"; import { fireEvent, render, screen } from "@testing-library/react"; -import NoteComponent from "../lib/components/noteComponent"; +import NoteComponent from "../lib/components/note_component"; import { RichUtils } from 'draft-js'; jest.mock('draft-js', () => ({ diff --git a/app/__tests__/searchBar.test.tsx b/app/__tests__/search_bar.test.tsx similarity index 100% rename from app/__tests__/searchBar.test.tsx rename to app/__tests__/search_bar.test.tsx diff --git a/app/lib/components/noteComponent.tsx b/app/lib/components/note_component.tsx similarity index 100% rename from app/lib/components/noteComponent.tsx rename to app/lib/components/note_component.tsx diff --git a/app/lib/components/searchBar.tsx b/app/lib/components/searchBar.tsx deleted file mode 100644 index 37a40ac0..00000000 --- a/app/lib/components/searchBar.tsx +++ /dev/null @@ -1,46 +0,0 @@ -'use client' -import React, { useState } from 'react'; -import ApiService from '../utils/ApiService'; - -const SearchBar = () => { - const [searchText, setSearchText] = typeof window !== 'undefined' ? useState('') : ['']; - - const handleSearch = async () => { - console.log("Search text:", searchText); - if (!searchText) { - console.log("Search text is empty. Aborting search."); - return; - } - try { - const response = await ApiService.searchMessages(searchText); - console.log('API Response:', response); - } catch (error) { - console.error('API Error:', error); - } - }; - - - return ( -
- setSearchText(e.target.value)} - /> - -
- ); -}; - -export default SearchBar; - - - - diff --git a/app/page.tsx b/app/page.tsx index 402acb6a..b237847e 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -2,7 +2,7 @@ import Image from "next/image"; import SearchBar from './lib/components/search_bar'; import AddNotePage from "./lib/pages/add_note_page"; import Sidebar from "./lib/components/side_bar"; -import NoteComponent from "./lib/components/noteComponent"; +import NoteComponent from "./lib/components/note_component"; export default function Home() { diff --git a/package.json b/package.json index 1c1dbc81..fb168d4b 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@testing-library/react": "^14.0.0", "@types/enzyme-adapter-react-16": "^1.0.7", "@types/jest": "^29.5.5", + "@types/moxios": "^0.4.16", "@types/node": "20.6.2", "@types/react": "18.2.22", "@types/react-dom": "18.2.7",