diff --git a/src/Components/Input/TextAreaInput.spec.tsx b/src/Components/Input/TextAreaInput.spec.tsx
new file mode 100644
index 00000000..0fe0a40f
--- /dev/null
+++ b/src/Components/Input/TextAreaInput.spec.tsx
@@ -0,0 +1,33 @@
+import { render, screen, fireEvent } from '@testing-library/react'
+import { describe, it, expect, beforeEach, vi } from 'vitest'
+
+import { TextAreaInput } from './TextAreaInput'
+
+describe('', () => {
+ let wrapper: ReturnType
+
+ const updateFormValue = vi.fn()
+
+ beforeEach(() => {
+ vi.clearAllMocks()
+ wrapper = render()
+ })
+
+ it('renders properly', () => {
+ expect(wrapper.container.firstChild).toMatchSnapshot()
+ })
+
+ describe('handleChange', () => {
+ it('calls updateFormValue with new value', () => {
+ fireEvent.change(screen.getByRole('textbox'), { target: { value: 'test' } })
+ expect(updateFormValue).toBeCalledWith('test')
+ })
+ })
+
+ describe('labelTitle', () => {
+ it('sets label', () => {
+ wrapper.rerender()
+ expect(wrapper.container.firstChild).toMatchSnapshot()
+ })
+ })
+})
diff --git a/src/Components/Input/TextAreaInput.tsx b/src/Components/Input/TextAreaInput.tsx
index 05549a36..660b0990 100644
--- a/src/Components/Input/TextAreaInput.tsx
+++ b/src/Components/Input/TextAreaInput.tsx
@@ -1,7 +1,5 @@
import { useEffect, useRef, useState } from 'react'
-import { useTags } from '#components/Map/hooks/useTags'
-
interface TextAreaProps {
labelTitle?: string
labelStyle?: string
@@ -14,8 +12,6 @@ interface TextAreaProps {
updateFormValue?: (value: string) => void
}
-type KeyValue = Record
-
/**
* @category Input
*/
@@ -33,14 +29,6 @@ export function TextAreaInput({
const ref = useRef(null)
const [inputValue, setInputValue] = useState(defaultValue)
- const tags = useTags()
-
- const values: KeyValue[] = []
-
- tags.forEach((tag) => {
- values.push({ key: tag.name, value: tag.name, color: tag.color })
- })
-
useEffect(() => {
setInputValue(defaultValue)
}, [defaultValue])
diff --git a/src/Components/Input/__snapshots__/TextAreaInput.spec.tsx.snap b/src/Components/Input/__snapshots__/TextAreaInput.spec.tsx.snap
new file mode 100644
index 00000000..48991cae
--- /dev/null
+++ b/src/Components/Input/__snapshots__/TextAreaInput.spec.tsx.snap
@@ -0,0 +1,34 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[` > labelTitle > sets label 1`] = `
+
+
+
+
+`;
+
+exports[` > renders properly 1`] = `
+
+
+
+`;
diff --git a/vite.config.ts b/vite.config.ts
index fd583db2..c4ae05d2 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -12,12 +12,12 @@ export default defineConfig({
coverage: {
all: true,
include: ['src/**/*.{js,jsx,ts,tsx}'],
- exclude: [...configDefaults.exclude],
+ exclude: [...configDefaults.exclude, 'src/**/*.cy.tsx'],
thresholds: {
- lines: 0,
- functions: 61,
+ lines: 1,
+ functions: 59,
branches: 62,
- statements: 0,
+ statements: 1,
},
},
},