Skip to content

Commit

Permalink
test(BigNumbers): increase code coverage (#6695)
Browse files Browse the repository at this point in the history
  • Loading branch information
anamikaanu96 authored Jan 14, 2025
1 parent b0a04c6 commit 24eeecc
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
import { render, screen } from '@testing-library/react'; // https://testing-library.com/docs/react-testing-library/intro
import { Button } from '@carbon/react';
import { Edit } from '@carbon/react/icons';
import { pkg } from '../../settings';
import { pkg, carbon } from '../../settings';
import uuidv4 from '../../global/js/utils/uuidv4';
import { BigNumbers } from '.';
import { BigNumbersSize } from './constants';
Expand Down Expand Up @@ -138,4 +138,17 @@ describe(componentName, () => {
componentName
);
});

it('should render a tooltip ', async () => {
renderBigNumbers({
tooltipDescription: 'Tooltip description',
trending: true,
'data-testid': dataTestId,
});
const element = screen.getByTestId(dataTestId);
const tooltipElement = element
.querySelector(`.${blockClass}__label`)
.getElementsByClassName(`span.${carbon.prefix}--tooltip`);
expect(tooltipElement).toBeTruthy();
});
});

0 comments on commit 24eeecc

Please sign in to comment.