Skip to content

Commit 63d707f

Browse files
committed
Update tests
1 parent f2702e3 commit 63d707f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

tests/unit/Bootstrap4Pagination.spec.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test('has correct DOM structure', function () {
6565

6666
expect(wrapper.find('ul').exists()).toBe(true);
6767
expect(wrapper.findAll('li').length).toBe(7);
68-
expect(wrapper.findAll('li').at(0).element.classList).toContain('active');
68+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('active');
6969
});
7070

7171
test('shows disabled links', function () {
@@ -75,7 +75,7 @@ test('shows disabled links', function () {
7575
showDisabled: true,
7676
},
7777
});
78-
expect(wrapper.findAll('li').at(0).element.classList).toContain('disabled');
78+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('disabled');
7979
expect(wrapper.findAll('a').at(0).element.tabIndex).toBe(-1);
8080
expect(wrapper.findAll('.disabled').length).toEqual(1);
8181
});
@@ -86,7 +86,7 @@ test('does not show disabled links', function () {
8686
data: exampleData,
8787
},
8888
});
89-
expect(wrapper.findAll('li').at(0).element.classList).not.toContain(
89+
expect([...wrapper.findAll('li').at(0).element.classList]).not.toContain(
9090
'disabled'
9191
);
9292
expect(wrapper.findAll('a').at(0).element.tabIndex).toBe(0);
@@ -125,7 +125,7 @@ test('has correct DOM structure with 1 link limit on page 5', function () {
125125

126126
expect(wrapper.find('ul').exists()).toBe(true);
127127
expect(wrapper.findAll('li').length).toBe(9);
128-
expect(wrapper.findAll('li').at(4).element.classList).toContain('active');
128+
expect([...wrapper.findAll('li').at(4).element.classList]).toContain('active');
129129
});
130130

131131
test('has correct DOM structure when on page 2', function () {
@@ -142,7 +142,7 @@ test('has correct DOM structure when on page 2', function () {
142142
});
143143

144144
expect(wrapper.findAll('li').length).toBe(8);
145-
expect(wrapper.findAll('li').at(2).element.classList).toContain('active');
145+
expect([...wrapper.findAll('li').at(2).element.classList]).toContain('active');
146146
});
147147

148148
test('emits correct event', function () {
@@ -183,7 +183,7 @@ test('has correct DOM structure for Laravel API Resource responses', function ()
183183

184184
expect(wrapper.find('ul').exists()).toBe(true);
185185
expect(wrapper.findAll('li').length).toBe(7);
186-
expect(wrapper.findAll('li').at(0).element.classList).toContain('active');
186+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('active');
187187
});
188188

189189
test('has correct size', function () {
@@ -194,7 +194,7 @@ test('has correct size', function () {
194194
},
195195
});
196196

197-
expect(wrapper.find('.pagination').element.classList).toContain(
197+
expect([...wrapper.find('.pagination').element.classList]).toContain(
198198
'pagination-sm'
199199
);
200200

@@ -205,7 +205,7 @@ test('has correct size', function () {
205205
},
206206
});
207207

208-
expect(wrapper.find('.pagination').element.classList).toContain(
208+
expect([...wrapper.find('.pagination').element.classList]).toContain(
209209
'pagination-lg'
210210
);
211211
});
@@ -218,7 +218,7 @@ test('has correct align', function () {
218218
},
219219
});
220220

221-
expect(wrapper.find('.pagination').element.classList).toContain(
221+
expect([...wrapper.find('.pagination').element.classList]).toContain(
222222
'justify-content-center'
223223
);
224224

@@ -229,7 +229,7 @@ test('has correct align', function () {
229229
},
230230
});
231231

232-
expect(wrapper.find('.pagination').element.classList).toContain(
232+
expect([...wrapper.find('.pagination').element.classList]).toContain(
233233
'justify-content-end'
234234
);
235235
});

tests/unit/Bootstrap5Pagination.spec.mjs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ test('has correct DOM structure', function () {
6565

6666
expect(wrapper.find('ul').exists()).toBe(true);
6767
expect(wrapper.findAll('li').length).toBe(7);
68-
expect(wrapper.findAll('li').at(0).element.classList).toContain('active');
68+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('active');
6969
});
7070

7171
test('shows disabled links', function () {
@@ -75,7 +75,7 @@ test('shows disabled links', function () {
7575
showDisabled: true,
7676
},
7777
});
78-
expect(wrapper.findAll('li').at(0).element.classList).toContain('disabled');
78+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('disabled');
7979
expect(wrapper.findAll('a').at(0).element.tabIndex).toBe(-1);
8080
expect(wrapper.findAll('.disabled').length).toEqual(1);
8181
});
@@ -86,7 +86,7 @@ test('does not show disabled links', function () {
8686
data: exampleData,
8787
},
8888
});
89-
expect(wrapper.findAll('li').at(0).element.classList).not.toContain(
89+
expect([...wrapper.findAll('li').at(0).element.classList]).not.toContain(
9090
'disabled'
9191
);
9292
expect(wrapper.findAll('a').at(0).element.tabIndex).toBe(0);
@@ -125,7 +125,7 @@ test('has correct DOM structure with 1 link limit on page 5', function () {
125125

126126
expect(wrapper.find('ul').exists()).toBe(true);
127127
expect(wrapper.findAll('li').length).toBe(9);
128-
expect(wrapper.findAll('li').at(4).element.classList).toContain('active');
128+
expect([...wrapper.findAll('li').at(4).element.classList]).toContain('active');
129129
});
130130

131131
test('has correct DOM structure when on page 2', function () {
@@ -142,7 +142,7 @@ test('has correct DOM structure when on page 2', function () {
142142
});
143143

144144
expect(wrapper.findAll('li').length).toBe(8);
145-
expect(wrapper.findAll('li').at(2).element.classList).toContain('active');
145+
expect([...wrapper.findAll('li').at(2).element.classList]).toContain('active');
146146
});
147147

148148
test('emits correct event', function () {
@@ -183,7 +183,7 @@ test('has correct DOM structure for Laravel API Resource responses', function ()
183183

184184
expect(wrapper.find('ul').exists()).toBe(true);
185185
expect(wrapper.findAll('li').length).toBe(7);
186-
expect(wrapper.findAll('li').at(0).element.classList).toContain('active');
186+
expect([...wrapper.findAll('li').at(0).element.classList]).toContain('active');
187187
});
188188

189189
test('has correct size', function () {
@@ -194,7 +194,7 @@ test('has correct size', function () {
194194
},
195195
});
196196

197-
expect(wrapper.find('.pagination').element.classList).toContain(
197+
expect([...wrapper.find('.pagination').element.classList]).toContain(
198198
'pagination-sm'
199199
);
200200

@@ -205,7 +205,7 @@ test('has correct size', function () {
205205
},
206206
});
207207

208-
expect(wrapper.find('.pagination').element.classList).toContain(
208+
expect([...wrapper.find('.pagination').element.classList]).toContain(
209209
'pagination-lg'
210210
);
211211
});
@@ -218,7 +218,7 @@ test('has correct align', function () {
218218
},
219219
});
220220

221-
expect(wrapper.find('.pagination').element.classList).toContain(
221+
expect([...wrapper.find('.pagination').element.classList]).toContain(
222222
'justify-content-center'
223223
);
224224

@@ -229,7 +229,7 @@ test('has correct align', function () {
229229
},
230230
});
231231

232-
expect(wrapper.find('.pagination').element.classList).toContain(
232+
expect([...wrapper.find('.pagination').element.classList]).toContain(
233233
'justify-content-end'
234234
);
235235
});

0 commit comments

Comments
 (0)