Skip to content

Commit

Permalink
[MWPW-165791] test coverage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DKos95 committed Jan 20, 2025
1 parent 7ca0dd5 commit 65d7353
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/blocks/table/table.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { readFile, sendMouse, sendKeys, resetMouse } from '@web/test-runner-commands';
import { expect } from 'chai';
import { MILO_EVENTS } from '../../../libs/utils/utils.js';
import { getConfig, MILO_EVENTS, setConfig } from '../../../libs/utils/utils.js';
import { delay, waitForElement } from '../../helpers/waitfor.js';

document.body.innerHTML = await readFile({ path: './mocks/body.html' });
const { default: init } = await import('../../../libs/blocks/table/table.js');
const config = getConfig();
config.env = { locale: { contentRoot: `${window.location.origin}` } };
setConfig(config);

describe('table and tablemetadata', () => {
beforeEach(() => {
Expand Down Expand Up @@ -111,5 +114,15 @@ describe('table and tablemetadata', () => {
expect(tooltipHeading.childNodes.length).to.equal(2);
expect(tooltipHeading.querySelector('.milo-tooltip, .icon-tooltip')).to.exist;
});

it('should apply aria-label to all selects within .filters on mobile', async () => {
window.innerWidth = 375;
window.dispatchEvent(new Event('resize'));
await delay(500);
const selectElements = document.querySelectorAll('.filters select');
selectElements.forEach((selectElement) => {
expect(selectElement.getAttribute('aria-label')).to.equal('choose table column');
});
});
});
});

0 comments on commit 65d7353

Please sign in to comment.