mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-18 10:51:10 +00:00
e42b235669
Depends-on: Ia271a57776e6f38384c5855727ab82fd7af83241 Bug: T330527 Change-Id: I756f8e1bcd86867bee52962a0d1c2dbb34ca75eb
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
const tables = require( '../../../resources/skins.vector.js/tables.js' ).init;
|
|
|
|
describe( 'tables', () => {
|
|
test( 'wraps table with div', () => {
|
|
document.body.innerHTML = `
|
|
<section class="mw-parser-output">
|
|
<table>
|
|
<tbody><tr><th>table table table</th></tr></tbody>
|
|
</table>
|
|
</section>
|
|
`;
|
|
tables();
|
|
|
|
expect( document.body.innerHTML ).toMatchSnapshot();
|
|
} );
|
|
|
|
test( 'wraps multiple table with div', () => {
|
|
document.body.innerHTML = `
|
|
<section class="mw-parser-output">
|
|
<table>
|
|
<tbody><tr><th>table table table</th></tr></tbody>
|
|
</table>
|
|
<table>
|
|
<tbody><tr><th>table table table</th></tr></tbody>
|
|
</table>
|
|
</section>
|
|
`;
|
|
tables();
|
|
|
|
expect( document.body.innerHTML ).toMatchSnapshot();
|
|
} );
|
|
|
|
test( 'doesnt wrap nested tables', () => {
|
|
document.body.innerHTML = `
|
|
<section class="mw-parser-output">
|
|
<table>
|
|
<tbody>
|
|
<tr><th>table table table</th></tr>
|
|
<tr><td><table><tbody><tr><th>table table table</th></tr></tbody></table><td></tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</section>
|
|
`;
|
|
tables();
|
|
|
|
expect( document.body.innerHTML ).toMatchSnapshot();
|
|
} );
|
|
} );
|