⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
explore
/
View File Name :
MetaInfoText.test.tsx
import { render, screen } from '@testing-library/react'; import React from 'react'; import { MetaInfoText, MetaItemProps } from './MetaInfoText'; describe('MetaInfoText', () => { it('should render component and items', () => { const items: MetaItemProps[] = [ { label: 'label', value: 'value' }, { label: 'label2', value: 'value2' }, ]; render(
); expect(screen.getAllByTestId('meta-info-text')).toHaveLength(1); expect(screen.getAllByTestId('meta-info-text-item')).toHaveLength(2); expect(screen.getByText('label:')).toBeInTheDocument(); expect(screen.getByText('label2:')).toBeInTheDocument(); expect(screen.getByText(/^value$/)).toBeInTheDocument(); expect(screen.getByText(/^value2$/)).toBeInTheDocument(); }); it('should render component with no items when the array is empty', () => { const items: MetaItemProps[] = []; render(
); expect(screen.getAllByTestId('meta-info-text')).toHaveLength(1); expect(screen.queryByTestId('meta-info-text-item')).toBeNull(); }); });