Skip to content

Commit c9c1819

Browse files
committed
fix code warnings
1 parent 536823c commit c9c1819

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

packages/uui-pagination/lib/uui-pagination.test.ts

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,37 @@ describe('UUIPaginationElement', () => {
3333
it('sets active class on current page', async () => {
3434
await waitUntil(() => element.visiblePages.length > 1);
3535
element.current = 2;
36-
const button = element.shadowRoot?.querySelector('#group')?.children[3]!;
36+
const button = element.shadowRoot?.querySelector('#group')!
37+
.children[3] as HTMLElement;
3738
await elementUpdated(button);
3839

39-
await expect(button).to.have.class('active-button');
40+
expect(button).to.have.class('active-button');
4041
});
4142

4243
it('goes to selected page on click', async () => {
4344
await waitUntil(() => element.visiblePages.length > 1);
44-
const button = element.shadowRoot?.querySelector('#group')
45-
?.children[3]! as HTMLElement;
45+
const button = element.shadowRoot?.querySelector('#group')!
46+
.children[3] as HTMLElement;
4647
button.click();
4748

4849
await elementUpdated(element);
4950

50-
await expect(button).to.have.class('active-button');
51-
await expect(element.current).to.equal(2);
51+
expect(button).to.have.class('active-button');
52+
expect(element.current).to.equal(2);
5253
});
5354

5455
it('goes to previous page on click', async () => {
5556
await waitUntil(() => element.visiblePages.length > 1);
5657
element.current = 2;
57-
const buttons = element.shadowRoot?.querySelector('#group')?.children;
58+
const buttons = element.shadowRoot?.querySelector('#group')!.children;
5859
const prevButton = buttons![1] as HTMLElement;
5960
const activeButton = buttons![2] as HTMLElement;
6061
prevButton.click();
6162

6263
await elementUpdated(element);
6364

64-
await expect(element.current).to.equal(1);
65-
await expect(activeButton).to.have.class('active-button');
65+
expect(element.current).to.equal(1);
66+
expect(activeButton).to.have.class('active-button');
6667
});
6768

6869
it('goes to next page on click', async () => {
@@ -75,8 +76,8 @@ describe('UUIPaginationElement', () => {
7576

7677
await elementUpdated(element);
7778

78-
await expect(element.current).to.equal(3);
79-
await expect(activeButton).to.have.class('active-button');
79+
expect(element.current).to.equal(3);
80+
expect(activeButton).to.have.class('active-button');
8081
});
8182

8283
it('goes to last page on click and disables last and next buttons', async () => {
@@ -91,10 +92,10 @@ describe('UUIPaginationElement', () => {
9192
buttons = element.shadowRoot?.querySelector('#group')?.children;
9293
const activeButton = buttons![5] as HTMLElement;
9394

94-
await expect(element.current).to.equal(30);
95-
await expect(activeButton).to.have.class('active-button');
96-
await expect(nextButton).to.have.attribute('disabled');
97-
await expect(lastButton).to.have.attribute('disabled');
95+
expect(element.current).to.equal(30);
96+
expect(activeButton).to.have.class('active-button');
97+
expect(nextButton).to.have.attribute('disabled');
98+
expect(lastButton).to.have.attribute('disabled');
9899
});
99100

100101
it('goes to first page on click and disables first and previous buttons', async () => {
@@ -108,10 +109,10 @@ describe('UUIPaginationElement', () => {
108109

109110
await elementUpdated(element);
110111

111-
await expect(element.current).to.equal(1);
112-
await expect(activeButton).to.have.class('active-button');
113-
await expect(firstButton).to.have.attribute('disabled');
114-
await expect(previousButton).to.have.attribute('disabled');
112+
expect(element.current).to.equal(1);
113+
expect(activeButton).to.have.class('active-button');
114+
expect(firstButton).to.have.attribute('disabled');
115+
expect(previousButton).to.have.attribute('disabled');
115116
});
116117

117118
it('shows the dots when more pages than visible', async () => {
@@ -125,7 +126,7 @@ describe('UUIPaginationElement', () => {
125126
const hasDots =
126127
arr.filter((e: HTMLElement) => e.classList.contains('dots-button'))
127128
.length > 0;
128-
await expect(hasDots).to.be.true;
129+
expect(hasDots).to.be.true;
129130
});
130131

131132
it('hides the dots when only one page', async () => {
@@ -139,10 +140,10 @@ describe('UUIPaginationElement', () => {
139140
const hasDots =
140141
arr.filter((e: HTMLElement) => e.classList.contains('dots-button'))
141142
.length > 0;
142-
await expect(hasDots).to.be.false;
143+
expect(hasDots).to.be.false;
143144
});
144145

145146
it('passes the a11y audit', async () => {
146-
await expect(element).shadowDom.to.be.accessible();
147+
expect(element).shadowDom.to.be.accessible();
147148
});
148149
});

0 commit comments

Comments
 (0)