getAriaLabel.spec.tsx 644 B

123456789101112131415161718192021
  1. import {getAriaLabel} from 'sentry/views/replays/detail/utils';
  2. describe('getAriaLabel', () => {
  3. it.each([
  4. {
  5. element:
  6. 'button#ID1.classA[role="button"][aria="View More"][data-test-id="button-test"][alt="view more"][title="cool title"]',
  7. ariaLabel: 'View More',
  8. },
  9. {
  10. element:
  11. 'button#ID1.classA[role="button"][data-test-id="button-test"][alt="view more"][title="cool title"]',
  12. ariaLabel: '',
  13. },
  14. ])(
  15. 'should construct the correct aria label for each element in the list',
  16. ({element, ariaLabel}) => {
  17. expect(getAriaLabel(element)).toStrictEqual(ariaLabel);
  18. }
  19. );
  20. });