import '@testing-library/jest-dom'; import $, {VeamsQueryObject} from '../src'; test('attr() - get attribute', () => { document.body.innerHTML = `

text content 2

text content 2
text content 3
`; const $targetEls: VeamsQueryObject = $('.target-el'); const attr: string = $targetEls.attr('tabindex') as string; expect(attr).toBe('0'); }); test('attr() - set attribute', () => { document.body.innerHTML = `

text content 2

text content 2
text content 3
`; const $targetEls: VeamsQueryObject = $('.target-el'); $targetEls.attr('tabindex', -1); expect($targetEls[0]).toHaveAttribute('tabindex', '-1'); expect($targetEls[1]).toHaveAttribute('tabindex', '-1'); expect($targetEls[2]).toHaveAttribute('tabindex', '-1'); });