2024-01-31 09:58:44 -05:00
|
|
|
import * as assert from 'node:assert/strict';
|
|
|
|
import { before, describe, it } from 'node:test';
|
2023-10-27 07:11:46 -05:00
|
|
|
import { parseHTML } from 'linkedom';
|
|
|
|
import { loadFixture } from './test-utils.js';
|
|
|
|
describe('Basics', () => {
|
|
|
|
/** @type {import('./test-utils').Fixture} */
|
|
|
|
let fixture;
|
|
|
|
|
|
|
|
before(async () => {
|
|
|
|
fixture = await loadFixture({
|
|
|
|
root: './fixtures/basics/',
|
|
|
|
});
|
|
|
|
await fixture.build();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Slots are added without the slot attribute', async () => {
|
|
|
|
const data = await fixture.readFile('/index.html');
|
|
|
|
const { document } = parseHTML(data);
|
|
|
|
const bar = document.querySelector('#foo');
|
|
|
|
|
2024-01-31 09:58:44 -05:00
|
|
|
assert.notEqual(bar, undefined);
|
|
|
|
assert.equal(bar.getAttribute('slot'), null);
|
2023-10-27 07:11:46 -05:00
|
|
|
});
|
|
|
|
});
|