|
1 | | -import {assert} from '@open-wc/testing' |
| 1 | +import {assert, expect} from '@open-wc/testing' |
2 | 2 | import '../src/index.ts' |
3 | 3 |
|
4 | 4 | describe('tab-container', function () { |
@@ -68,9 +68,16 @@ describe('tab-container', function () { |
68 | 68 | }) |
69 | 69 |
|
70 | 70 | afterEach(function () { |
| 71 | + // Check to make sure we still have accessible markup after the test finishes running. |
| 72 | + expect(document.body).to.be.accessible() |
| 73 | + |
71 | 74 | document.body.innerHTML = '' |
72 | 75 | }) |
73 | 76 |
|
| 77 | + it('has accessible markup', function () { |
| 78 | + expect(document.body).to.be.accessible() |
| 79 | + }) |
| 80 | + |
74 | 81 | it('the second tab is still selected', function () { |
75 | 82 | assert.deepStrictEqual(tabs.map(isSelected), [false, true, false], 'Second tab is selected') |
76 | 83 | assert.deepStrictEqual(panels.map(isHidden), [true, false, true], 'Second panel is visible') |
@@ -100,9 +107,16 @@ describe('tab-container', function () { |
100 | 107 | }) |
101 | 108 |
|
102 | 109 | afterEach(function () { |
| 110 | + // Check to make sure we still have accessible markup after the test finishes running. |
| 111 | + expect(document.body).to.be.accessible() |
| 112 | + |
103 | 113 | document.body.innerHTML = '' |
104 | 114 | }) |
105 | 115 |
|
| 116 | + it('has accessible markup', function () { |
| 117 | + expect(document.body).to.be.accessible() |
| 118 | + }) |
| 119 | + |
106 | 120 | it('the second tab is still selected', function () { |
107 | 121 | assert.deepStrictEqual(tabs.map(isSelected), [false, true, false], 'Second tab is selected') |
108 | 122 | assert.deepStrictEqual(panels.map(isHidden), [true, false, true], 'Second panel is visible') |
@@ -138,9 +152,16 @@ describe('tab-container', function () { |
138 | 152 | }) |
139 | 153 |
|
140 | 154 | afterEach(function () { |
| 155 | + // Check to make sure we still have accessible markup after the test finishes running. |
| 156 | + expect(document.body).to.be.accessible() |
| 157 | + |
141 | 158 | document.body.innerHTML = '' |
142 | 159 | }) |
143 | 160 |
|
| 161 | + it('has accessible markup', function () { |
| 162 | + expect(document.body).to.be.accessible() |
| 163 | + }) |
| 164 | + |
144 | 165 | it('click works and `tab-container-changed` event is dispatched', function () { |
145 | 166 | tabs[1].click() |
146 | 167 | assert.deepStrictEqual(tabs.map(isSelected), [false, true, false], 'Second tab is selected') |
@@ -331,9 +352,16 @@ describe('tab-container', function () { |
331 | 352 | }) |
332 | 353 |
|
333 | 354 | afterEach(function () { |
| 355 | + // Check to make sure we still have accessible markup after the test finishes running. |
| 356 | + expect(document.body).to.be.accessible() |
| 357 | + |
334 | 358 | document.body.innerHTML = '' |
335 | 359 | }) |
336 | 360 |
|
| 361 | + it('has accessible markup', function () { |
| 362 | + expect(document.body).to.be.accessible() |
| 363 | + }) |
| 364 | + |
337 | 365 | it('only switches closest tab-containers on click', () => { |
338 | 366 | assert.deepStrictEqual(tabs.map(isSelected), [true, false, false]) |
339 | 367 | assert.deepStrictEqual(nestedTabs.map(isSelected), [true, false]) |
|
0 commit comments