| 1 |
/** |
| 2 |
* @license |
| 3 |
* Copyright 2022 Google LLC |
| 4 |
* SPDX-License-Identifier: BSD-3-Clause |
| 5 |
*/ |
| 6 |
|
| 7 |
import {expect} from '@open-wc/testing'; |
| 8 |
|
| 9 |
describe('main module', () => { |
| 10 |
// The side-effect of the `lit-virtualizer` customElements registry entry |
| 11 |
// is not be cleared between tests, so this test must run first, before the |
| 12 |
// customElements.define() side-effect is invoked on the import. |
| 13 |
it('defines lit-virtualizer element', async () => { |
| 14 |
expect(customElements.get('lit-virtualizer')).to.be.undefined; |
| 15 |
await import('../../lit-virtualizer.js'); |
| 16 |
expect(customElements.get('lit-virtualizer')).to.be.instanceOf(Function); |
| 17 |
}); |
| 18 |
it('exports LitVirtualizer', async () => { |
| 19 |
const {LitVirtualizer} = await import('../../lit-virtualizer.js'); |
| 20 |
expect(LitVirtualizer).to.be.instanceOf(Function); |
| 21 |
}); |
| 22 |
it('exports RangeChangedEvent', async () => { |
| 23 |
const {RangeChangedEvent} = await import('../../lit-virtualizer.js'); |
| 24 |
expect(RangeChangedEvent.prototype).to.be.instanceOf(Event); |
| 25 |
}); |
| 26 |
it('exports VisibilityChangedEvent', async () => { |
| 27 |
const {VisibilityChangedEvent} = await import('../../lit-virtualizer.js'); |
| 28 |
expect(VisibilityChangedEvent.prototype).to.be.instanceOf(Event); |
| 29 |
}); |
| 30 |
}); |