deviceName.spec.tsx 597 B

123456789101112131415161718
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {DeviceName} from 'sentry/components/deviceName';
  3. jest.mock('ios-device-list');
  4. describe('DeviceName', () => {
  5. it('renders device name if module is loaded', async () => {
  6. render(<DeviceName value="iPhone8,2" />);
  7. expect(await screen.findByText('iPhone 6s Plus')).toBeInTheDocument();
  8. });
  9. it('renders device name if name helper returns undefined', async () => {
  10. render(<DeviceName value="iPhone8,2FunkyValue" />);
  11. expect(await screen.findByText('iPhone8,2FunkyValue')).toBeInTheDocument();
  12. });
  13. });