progressBar.spec.tsx 704 B

12345678910111213141516171819202122
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import ProgressBar from 'sentry/components/progressBar';
  3. describe('ProgressBar', function () {
  4. it('basic', function () {
  5. const progressBarValue = 50;
  6. render(<ProgressBar value={progressBarValue} />);
  7. const elementProperties = screen.getByRole('progressbar');
  8. // element exists
  9. expect(elementProperties).toBeInTheDocument();
  10. // check aria attributes
  11. expect(elementProperties).toHaveAttribute(
  12. 'aria-valuenow',
  13. progressBarValue.toString()
  14. );
  15. expect(elementProperties).toHaveAttribute('aria-valuemin', '0');
  16. expect(elementProperties).toHaveAttribute('aria-valuemax', '100');
  17. });
  18. });