progressBar.spec.tsx 731 B

12345678910111213141516171819202122
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import ProgressBar from 'app/components/progressBar';
  3. describe('ProgressBar', function () {
  4. it('basic', function () {
  5. const progressBarValue = 50;
  6. const wrapper = mountWithTheme(<ProgressBar value={progressBarValue} />);
  7. // element exists
  8. expect(wrapper.length).toEqual(1);
  9. const elementProperties = wrapper.find('div').props();
  10. expect(elementProperties).toHaveProperty('role', 'progressbar');
  11. // check aria attributes
  12. expect(elementProperties).toHaveProperty('aria-valuenow', progressBarValue);
  13. expect(elementProperties).toHaveProperty('aria-valuemin', 0);
  14. expect(elementProperties).toHaveProperty('aria-valuemax', 100);
  15. });
  16. });