import { type E2EElement, type E2EPage, newE2EPage } from '@stencil/core/testing'; describe('ods-pagination accessibility', () => { let el: E2EElement; let page: E2EPage; async function setup(content: string): Promise { page = await newE2EPage(); await page.setContent(content); el = await page.find('ods-pagination'); } it('should not allow for a defaultCurrentPage lower than 1', async() => { await setup(''); const current = await el.callMethod('getCurrentPage'); expect(current).toBe(1); }); it('should not allow for a defaultCurrentPage higher than total number of pages', async() => { await setup(''); const current = await el.callMethod('getCurrentPage'); expect(current).toBe(5); }); it('should show both slots and the totalItems number', async() => { await setup(` of   results `); const totalItemsTextElement = await page.find('ods-pagination >>> .ods-pagination__results__label'); expect(totalItemsTextElement).toBeDefined(); expect(totalItemsTextElement.innerText).toContain('5'); const textSlotElements = await totalItemsTextElement.findAll('slot'); expect(textSlotElements.length).toBe(2); }); });