Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added RangeChangedEvent and VisibilityChangedEvent to main module exp…
…orts. (#3215)
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lit-labs/virtualizer': patch | ||
--- | ||
|
||
Exported RangeChangedEvent and VisibilityChangedEvent from main module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/labs/virtualizer/src/test/scenarios/main-module.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @license | ||
* Copyright 2022 Google LLC | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
import {expect} from '@open-wc/testing'; | ||
const MAIN_MODULE = '../../lit-virtualizer.js'; | ||
|
||
describe('main module', () => { | ||
// The side-effect of the `lit-virtualizer` customElements registry entry | ||
// is not be cleared between tests, so this test must run first, before the | ||
// customElements.define() side-effect is invoked on the import. | ||
it('defines lit-virtualizer element', async () => { | ||
expect(customElements.get('lit-virtualizer')).to.be.undefined; | ||
await import(MAIN_MODULE); | ||
expect(customElements.get('lit-virtualizer')).to.be.instanceOf(Function); | ||
}); | ||
it('exports LitVirtualizer', async () => { | ||
const {LitVirtualizer} = await import(MAIN_MODULE); | ||
expect(LitVirtualizer).to.be.instanceOf(Function); | ||
}); | ||
it('exports RangeChangedEvent', async () => { | ||
const {RangeChangedEvent} = await import(MAIN_MODULE); | ||
expect(RangeChangedEvent.prototype).to.be.instanceOf(Event); | ||
}); | ||
it('exports VisibilityChangedEvent', async () => { | ||
const {VisibilityChangedEvent} = await import(MAIN_MODULE); | ||
expect(VisibilityChangedEvent.prototype).to.be.instanceOf(Event); | ||
}); | ||
}); |