Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add: test for pin

kruzhambusa6cec4425506
diff --git a/src/ui/test/Pin.test.tsx b/src/ui/test/Pin.test.tsx
new file mode 100644
index 000000000..8a2a26757
--- /dev/null
+++ b/src/ui/test/Pin.test.tsx
@@ -0,0 +1,42 @@
+/* eslint-disable testing-library/prefer-screen-queries */
+/* eslint-disable import/no-extraneous-dependencies */
+import React from 'react'
+import { render } from '@testing-library/react'
+import {
+ WarningPin, ActivePin, InactivePin, CustomPin,
+} from '../Pin'
+
+describe('Pin', () => {
+ const defaultProps: {
+ label: string,
+ className?: string,
+ } = {
+ label: 'label',
+ className: 'className',
+ }
+
+ it('renders the warning pin', () => {
+ const { getByText } = render(<WarningPin {...defaultProps} />)
+ expect(getByText('label')).toBeInTheDocument()
+ })
+
+ it('renders the active pin', () => {
+ const { getByText } = render(<ActivePin {...defaultProps} />)
+ expect(getByText('label')).toBeInTheDocument()
+ })
+
+ it('renders the inactive pin', () => {
+ const { getByText } = render(<InactivePin {...defaultProps} />)
+ expect(getByText('label')).toBeInTheDocument()
+ })
+
+ it('renders the custom pin', () => {
+ const { getByText } = render(<CustomPin {...defaultProps} />)
+ expect(getByText('label')).toBeInTheDocument()
+ })
+
+ it('renders the custom pin with custom className', () => {
+ const { getByText } = render(<CustomPin {...defaultProps} className='customClassName' />)
+ expect(getByText('label')).toBeInTheDocument()
+ })
+})