@ons/design-system 65.2.2 → 65.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/card/example-card-set-with-lists.njk +6 -6
- package/components/checkboxes/_checkbox.scss +0 -2
- package/components/download-resources/download-resources.spec.js +37 -36
- package/components/navigation/navigation.js +0 -2
- package/components/tabs/_macro.njk +2 -2
- package/components/tabs/_macro.spec.js +4 -20
- package/components/tabs/example-tabs.njk +1 -0
- package/components/tabs/tabs.spec.js +52 -44
- package/css/main.css +1 -243
- package/layout/_template.njk +48 -43
- package/package.json +13 -15
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"itemsList": [
|
|
14
14
|
{
|
|
15
15
|
"url": '#0',
|
|
16
|
-
"text": 'List item 1'
|
|
16
|
+
"text": 'List item 1 about the census'
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"url": '#0',
|
|
20
|
-
"text": 'List item 2'
|
|
20
|
+
"text": 'List item 2 about the census'
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
}) }}
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"itemsList": [
|
|
34
34
|
{
|
|
35
35
|
"url": '#0',
|
|
36
|
-
"text": 'List item 1'
|
|
36
|
+
"text": 'List item 1 about working on the census'
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"url": '#0',
|
|
40
|
-
"text": 'List item 2'
|
|
40
|
+
"text": 'List item 2 about working on the census'
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
}) }}
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"itemsList": [
|
|
54
54
|
{
|
|
55
55
|
"url": '#0',
|
|
56
|
-
"text": 'List item 1'
|
|
56
|
+
"text": 'List item 1 about your data and security'
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"url": '#0',
|
|
60
|
-
"text": 'List item 2'
|
|
60
|
+
"text": 'List item 2 about your data and security'
|
|
61
61
|
}
|
|
62
62
|
]
|
|
63
63
|
}) }}
|
|
@@ -94,7 +94,6 @@ $checkbox-padding: 11px;
|
|
|
94
94
|
|
|
95
95
|
&:checked,
|
|
96
96
|
&:focus {
|
|
97
|
-
background-color: initial;
|
|
98
97
|
|
|
99
98
|
& + .ons-checkbox__label::before {
|
|
100
99
|
background: none;
|
|
@@ -123,7 +122,6 @@ $checkbox-padding: 11px;
|
|
|
123
122
|
|
|
124
123
|
&:checked,
|
|
125
124
|
&:focus {
|
|
126
|
-
background-color: initial;
|
|
127
125
|
|
|
128
126
|
& + .ons-checkbox__label::before {
|
|
129
127
|
background: none;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { KnownDevices } from 'puppeteer';
|
|
3
2
|
import { setViewport } from '../../tests/helpers/puppeteer';
|
|
4
3
|
import { renderComponent, renderTemplate, setTestPage } from '../../tests/helpers/rendering';
|
|
5
4
|
|
|
5
|
+
const iPhoneX = KnownDevices['iPhone X'];
|
|
6
|
+
|
|
6
7
|
const EXAMPLE_PAGE = `
|
|
7
8
|
<div class="ons-page">
|
|
8
9
|
<div class="ons-js-adv-filter">
|
|
@@ -199,12 +200,12 @@ describe('script: download-resources', () => {
|
|
|
199
200
|
});
|
|
200
201
|
|
|
201
202
|
it('updates result count text', async () => {
|
|
202
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
203
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
203
204
|
expect(resultsCount).toBe('3');
|
|
204
205
|
});
|
|
205
206
|
|
|
206
207
|
it('hides the "No results" content', async () => {
|
|
207
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
208
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
208
209
|
expect(isHidden).toBe(true);
|
|
209
210
|
});
|
|
210
211
|
});
|
|
@@ -226,12 +227,12 @@ describe('script: download-resources', () => {
|
|
|
226
227
|
});
|
|
227
228
|
|
|
228
229
|
it('updates result count text', async () => {
|
|
229
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
230
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
230
231
|
expect(resultsCount).toBe('0');
|
|
231
232
|
});
|
|
232
233
|
|
|
233
234
|
it('shows the "No results" content', async () => {
|
|
234
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
235
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
235
236
|
expect(isHidden).toBe(false);
|
|
236
237
|
});
|
|
237
238
|
});
|
|
@@ -253,12 +254,12 @@ describe('script: download-resources', () => {
|
|
|
253
254
|
});
|
|
254
255
|
|
|
255
256
|
it('updates result count text', async () => {
|
|
256
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
257
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
257
258
|
expect(resultsCount).toBe('2');
|
|
258
259
|
});
|
|
259
260
|
|
|
260
261
|
it('hides the "No results" content', async () => {
|
|
261
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
262
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
262
263
|
expect(isHidden).toBe(true);
|
|
263
264
|
});
|
|
264
265
|
});
|
|
@@ -281,12 +282,12 @@ describe('script: download-resources', () => {
|
|
|
281
282
|
});
|
|
282
283
|
|
|
283
284
|
it('updates result count text', async () => {
|
|
284
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
285
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
285
286
|
expect(resultsCount).toBe('3');
|
|
286
287
|
});
|
|
287
288
|
|
|
288
289
|
it('hides the "No results" content', async () => {
|
|
289
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
290
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
290
291
|
expect(isHidden).toBe(true);
|
|
291
292
|
});
|
|
292
293
|
});
|
|
@@ -309,12 +310,12 @@ describe('script: download-resources', () => {
|
|
|
309
310
|
});
|
|
310
311
|
|
|
311
312
|
it('updates result count text', async () => {
|
|
312
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
313
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
313
314
|
expect(resultsCount).toBe('0');
|
|
314
315
|
});
|
|
315
316
|
|
|
316
317
|
it('shows the "No results" content', async () => {
|
|
317
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
318
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
318
319
|
expect(isHidden).toBe(false);
|
|
319
320
|
});
|
|
320
321
|
});
|
|
@@ -337,12 +338,12 @@ describe('script: download-resources', () => {
|
|
|
337
338
|
});
|
|
338
339
|
|
|
339
340
|
it('updates result count text', async () => {
|
|
340
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
341
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
341
342
|
expect(resultsCount).toBe('2');
|
|
342
343
|
});
|
|
343
344
|
|
|
344
345
|
it('hides the "No results" content', async () => {
|
|
345
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
346
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
346
347
|
expect(isHidden).toBe(true);
|
|
347
348
|
});
|
|
348
349
|
});
|
|
@@ -365,12 +366,12 @@ describe('script: download-resources', () => {
|
|
|
365
366
|
});
|
|
366
367
|
|
|
367
368
|
it('updates result count text', async () => {
|
|
368
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
369
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
369
370
|
expect(resultsCount).toBe('1');
|
|
370
371
|
});
|
|
371
372
|
|
|
372
373
|
it('hides the "No results" content', async () => {
|
|
373
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
374
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
374
375
|
expect(isHidden).toBe(true);
|
|
375
376
|
});
|
|
376
377
|
});
|
|
@@ -394,12 +395,12 @@ describe('script: download-resources', () => {
|
|
|
394
395
|
});
|
|
395
396
|
|
|
396
397
|
it('updates result count text', async () => {
|
|
397
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
398
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
398
399
|
expect(resultsCount).toBe('2');
|
|
399
400
|
});
|
|
400
401
|
|
|
401
402
|
it('hides the "No results" content', async () => {
|
|
402
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
403
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
403
404
|
expect(isHidden).toBe(true);
|
|
404
405
|
});
|
|
405
406
|
});
|
|
@@ -432,7 +433,7 @@ describe('script: download-resources', () => {
|
|
|
432
433
|
|
|
433
434
|
it('resets state of all filter checkboxes ', async () => {
|
|
434
435
|
const selector = '.ons-js-adv-filter__item .ons-js-checkbox';
|
|
435
|
-
const checkboxStates = await page.$$eval(selector, nodes => nodes.map(node => `${node.id}: ${node.checked}`));
|
|
436
|
+
const checkboxStates = await page.$$eval(selector, (nodes) => nodes.map((node) => `${node.id}: ${node.checked}`));
|
|
436
437
|
|
|
437
438
|
expect(checkboxStates).toEqual(['community-groups: false', 'general-public: false', 'booklet: false', 'logo: false']);
|
|
438
439
|
});
|
|
@@ -448,12 +449,12 @@ describe('script: download-resources', () => {
|
|
|
448
449
|
});
|
|
449
450
|
|
|
450
451
|
it('updates result count text', async () => {
|
|
451
|
-
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', node => node.textContent.trim());
|
|
452
|
+
const resultsCount = await page.$eval('.ons-js-adv-filter__results-count', (node) => node.textContent.trim());
|
|
452
453
|
expect(resultsCount).toBe('3');
|
|
453
454
|
});
|
|
454
455
|
|
|
455
456
|
it('hides the "No results" content', async () => {
|
|
456
|
-
const isHidden = await page.$eval('.ons-adv-filter__no-results', node => node.classList.contains('ons-u-hidden'));
|
|
457
|
+
const isHidden = await page.$eval('.ons-adv-filter__no-results', (node) => node.classList.contains('ons-u-hidden'));
|
|
457
458
|
expect(isHidden).toBe(true);
|
|
458
459
|
});
|
|
459
460
|
});
|
|
@@ -470,19 +471,19 @@ describe('script: download-resources', () => {
|
|
|
470
471
|
});
|
|
471
472
|
|
|
472
473
|
it('hides elements that are only needed for mobile', async () => {
|
|
473
|
-
const displayStyle = await page.$eval('.ons-adv-filter__trigger', node => getComputedStyle(node).display);
|
|
474
|
+
const displayStyle = await page.$eval('.ons-adv-filter__trigger', (node) => getComputedStyle(node).display);
|
|
474
475
|
expect(displayStyle).toBe('none');
|
|
475
476
|
});
|
|
476
477
|
|
|
477
478
|
it('shows filter elements', async () => {
|
|
478
|
-
const displayStyle = await page.$eval('.ons-adv-filter__panel', node => getComputedStyle(node).display);
|
|
479
|
+
const displayStyle = await page.$eval('.ons-adv-filter__panel', (node) => getComputedStyle(node).display);
|
|
479
480
|
expect(displayStyle).not.toBe('none');
|
|
480
481
|
});
|
|
481
482
|
});
|
|
482
483
|
|
|
483
484
|
describe('when the viewport is small', () => {
|
|
484
485
|
beforeEach(async () => {
|
|
485
|
-
await page.emulate(
|
|
486
|
+
await page.emulate(iPhoneX);
|
|
486
487
|
await setTestPage('/test', RENDERED_EXAMPLE_PAGE);
|
|
487
488
|
});
|
|
488
489
|
|
|
@@ -492,27 +493,27 @@ describe('script: download-resources', () => {
|
|
|
492
493
|
});
|
|
493
494
|
|
|
494
495
|
it('shows elements that are only needed for mobile', async () => {
|
|
495
|
-
const displayStyle = await page.$eval('.ons-adv-filter__trigger', node => getComputedStyle(node).display);
|
|
496
|
+
const displayStyle = await page.$eval('.ons-adv-filter__trigger', (node) => getComputedStyle(node).display);
|
|
496
497
|
expect(displayStyle).not.toBe('none');
|
|
497
498
|
});
|
|
498
499
|
|
|
499
500
|
it('hides filter elements', async () => {
|
|
500
|
-
const displayStyle = await page.$eval('.ons-adv-filter__panel', node => getComputedStyle(node).display);
|
|
501
|
+
const displayStyle = await page.$eval('.ons-adv-filter__panel', (node) => getComputedStyle(node).display);
|
|
501
502
|
expect(displayStyle).toBe('none');
|
|
502
503
|
});
|
|
503
504
|
|
|
504
505
|
it('shows filter elements when the "Show filters" button is pressed', async () => {
|
|
505
506
|
await page.click('.ons-js-adv-filter__trigger');
|
|
506
507
|
|
|
507
|
-
const displayStyle = await page.$eval('.ons-adv-filter__panel', node => getComputedStyle(node).display);
|
|
508
|
+
const displayStyle = await page.$eval('.ons-adv-filter__panel', (node) => getComputedStyle(node).display);
|
|
508
509
|
expect(displayStyle).not.toBe('none');
|
|
509
510
|
});
|
|
510
511
|
|
|
511
512
|
it('hides the underlying page elements when the "Show filters" button is pressed', async () => {
|
|
512
513
|
await page.click('.ons-js-adv-filter__trigger');
|
|
513
514
|
|
|
514
|
-
const pageIsHidden = await page.$eval('.ons-page', node => node.classList.contains('ons-u-d-no'));
|
|
515
|
-
const pageIsAriaHidden = await page.$eval('.ons-page', node => node.getAttribute('aria-hidden'));
|
|
515
|
+
const pageIsHidden = await page.$eval('.ons-page', (node) => node.classList.contains('ons-u-d-no'));
|
|
516
|
+
const pageIsAriaHidden = await page.$eval('.ons-page', (node) => node.getAttribute('aria-hidden'));
|
|
516
517
|
|
|
517
518
|
expect(pageIsHidden).toBe(true);
|
|
518
519
|
expect(pageIsAriaHidden).toBe('true');
|
|
@@ -522,7 +523,7 @@ describe('script: download-resources', () => {
|
|
|
522
523
|
await page.click('.ons-js-adv-filter__trigger');
|
|
523
524
|
await page.click('.ons-js-adv-filter__show');
|
|
524
525
|
|
|
525
|
-
const displayStyle = await page.$eval('.ons-adv-filter__panel', node => getComputedStyle(node).display);
|
|
526
|
+
const displayStyle = await page.$eval('.ons-adv-filter__panel', (node) => getComputedStyle(node).display);
|
|
526
527
|
expect(displayStyle).toBe('none');
|
|
527
528
|
});
|
|
528
529
|
|
|
@@ -530,8 +531,8 @@ describe('script: download-resources', () => {
|
|
|
530
531
|
await page.click('.ons-js-adv-filter__trigger');
|
|
531
532
|
await page.click('.ons-js-adv-filter__show');
|
|
532
533
|
|
|
533
|
-
const pageIsHidden = await page.$eval('.ons-page', node => node.classList.contains('ons-u-d-no'));
|
|
534
|
-
const pageIsAriaHidden = await page.$eval('.ons-page', node => node.getAttribute('aria-hidden'));
|
|
534
|
+
const pageIsHidden = await page.$eval('.ons-page', (node) => node.classList.contains('ons-u-d-no'));
|
|
535
|
+
const pageIsAriaHidden = await page.$eval('.ons-page', (node) => node.getAttribute('aria-hidden'));
|
|
535
536
|
|
|
536
537
|
expect(pageIsHidden).toBe(false);
|
|
537
538
|
expect(pageIsAriaHidden).toBe('false');
|
|
@@ -541,7 +542,7 @@ describe('script: download-resources', () => {
|
|
|
541
542
|
await page.click('.ons-js-adv-filter__trigger');
|
|
542
543
|
await page.click('.ons-js-adv-filter__close');
|
|
543
544
|
|
|
544
|
-
const displayStyle = await page.$eval('.ons-adv-filter__panel', node => getComputedStyle(node).display);
|
|
545
|
+
const displayStyle = await page.$eval('.ons-adv-filter__panel', (node) => getComputedStyle(node).display);
|
|
545
546
|
expect(displayStyle).toBe('none');
|
|
546
547
|
});
|
|
547
548
|
|
|
@@ -549,8 +550,8 @@ describe('script: download-resources', () => {
|
|
|
549
550
|
await page.click('.ons-js-adv-filter__trigger');
|
|
550
551
|
await page.click('.ons-js-adv-filter__close');
|
|
551
552
|
|
|
552
|
-
const pageIsHidden = await page.$eval('.ons-page', node => node.classList.contains('ons-u-d-no'));
|
|
553
|
-
const pageIsAriaHidden = await page.$eval('.ons-page', node => node.getAttribute('aria-hidden'));
|
|
553
|
+
const pageIsHidden = await page.$eval('.ons-page', (node) => node.classList.contains('ons-u-d-no'));
|
|
554
|
+
const pageIsAriaHidden = await page.$eval('.ons-page', (node) => node.getAttribute('aria-hidden'));
|
|
554
555
|
|
|
555
556
|
expect(pageIsHidden).toBe(false);
|
|
556
557
|
expect(pageIsAriaHidden).toBe('false');
|
|
@@ -559,7 +560,7 @@ describe('script: download-resources', () => {
|
|
|
559
560
|
});
|
|
560
561
|
|
|
561
562
|
async function getTextContent(page, selector) {
|
|
562
|
-
return await page.$$eval(selector, nodes => nodes.map(node => node.textContent.trim()));
|
|
563
|
+
return await page.$$eval(selector, (nodes) => nodes.map((node) => node.textContent.trim()));
|
|
563
564
|
}
|
|
564
565
|
|
|
565
566
|
async function getFilterSelectionLabels(page) {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{% if params.noInitialActiveTab %}data-no-initial-active-tab="true"{% endif %}
|
|
12
12
|
>
|
|
13
13
|
{% set titleTag = params.titleTag | default("h2") %}
|
|
14
|
-
<{{ titleTag }} class="ons-tabs__title ons-u-fs-r--b ons-u-mt-no">{{ params.title }}</{{ titleTag }}>
|
|
14
|
+
<{{ titleTag }} class="ons-tabs__title ons-u-fs-r--b ons-u-mt-no{% if params.titleClasses %} {{ params.titleClasses }}{% endif %}">{{ params.title }}</{{ titleTag }}>
|
|
15
15
|
<div>
|
|
16
16
|
<ul class="ons-tabs__list">
|
|
17
17
|
{%- for tab in params.tabs -%}
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
{% if tab.showTitle %}<h2 id="{{ tab.title|trim|replace(' ','-')|lower + '-content-title' }}" class="ons-u-vh">{{ tab.title }}</h2>{% endif %}
|
|
25
25
|
{{ tab.content | safe }}
|
|
26
26
|
</section>
|
|
27
|
-
{% endfor %}
|
|
27
|
+
{% endfor %}
|
|
28
28
|
</section>
|
|
29
29
|
{% endmacro %}
|
|
@@ -76,11 +76,7 @@ describe('macro: tabs', () => {
|
|
|
76
76
|
it('has the provided `title`', () => {
|
|
77
77
|
const $ = cheerio.load(renderComponent('tabs', EXAMPLE_TABS));
|
|
78
78
|
|
|
79
|
-
expect(
|
|
80
|
-
$('.ons-tabs__title')
|
|
81
|
-
.text()
|
|
82
|
-
.trim(),
|
|
83
|
-
).toBe('Example tabs');
|
|
79
|
+
expect($('.ons-tabs__title').text().trim()).toBe('Example tabs');
|
|
84
80
|
});
|
|
85
81
|
|
|
86
82
|
it('has title with provided tag override', () => {
|
|
@@ -113,11 +109,7 @@ describe('macro: tabs', () => {
|
|
|
113
109
|
const $ = cheerio.load(renderComponent('tabs', EXAMPLE_TABS));
|
|
114
110
|
|
|
115
111
|
expect($('.ons-tab:first').html()).toBe('Tab 1<span class="ons-u-vh">for Example</span>');
|
|
116
|
-
expect(
|
|
117
|
-
$('.ons-tab:last')
|
|
118
|
-
.text()
|
|
119
|
-
.trim(),
|
|
120
|
-
).toBe('Tab 2');
|
|
112
|
+
expect($('.ons-tab:last').text().trim()).toBe('Tab 2');
|
|
121
113
|
});
|
|
122
114
|
|
|
123
115
|
it('has Google Analytics integration on tab links', () => {
|
|
@@ -133,16 +125,8 @@ describe('macro: tabs', () => {
|
|
|
133
125
|
it('has expected content in tab panels', () => {
|
|
134
126
|
const $ = cheerio.load(renderComponent('tabs', EXAMPLE_TABS));
|
|
135
127
|
|
|
136
|
-
expect(
|
|
137
|
-
|
|
138
|
-
.html()
|
|
139
|
-
.trim(),
|
|
140
|
-
).toBe('Example content...');
|
|
141
|
-
expect(
|
|
142
|
-
$('.ons-tabs__panel:last')
|
|
143
|
-
.html()
|
|
144
|
-
.trim(),
|
|
145
|
-
).toBe('Some nested <strong>strong element</strong>...');
|
|
128
|
+
expect($('.ons-tabs__panel:first').html().trim()).toBe('Example content...');
|
|
129
|
+
expect($('.ons-tabs__panel:last').html().trim()).toBe('Some nested <strong>strong element</strong>...');
|
|
146
130
|
});
|
|
147
131
|
|
|
148
132
|
it('displays a h2 when showTitle set to true', () => {
|