Skip to content

Commit

Permalink
refactor: remove unused internal mixin detection property (#6928)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Dec 7, 2023
1 parent 1fb3395 commit a5fd954
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
5 changes: 0 additions & 5 deletions packages/a11y-base/src/list-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export declare function ListMixin<T extends Constructor<HTMLElement>>(
): Constructor<KeyboardDirectionMixinClass> & Constructor<KeyboardMixinClass> & Constructor<ListMixinClass> & T;

export declare class ListMixinClass {
/**
* Used for mixin detection because `instanceof` does not work with mixins.
*/
_hasVaadinListMixin: boolean;

/**
* If true, the user cannot interact with this element.
* When the element is disabled, the selected item is
Expand Down
8 changes: 0 additions & 8 deletions packages/a11y-base/src/list-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ export const ListMixin = (superClass) =>
class ListMixinClass extends KeyboardDirectionMixin(superClass) {
static get properties() {
return {
/**
* Used for mixin detection because `instanceof` does not work with mixins.
* @type {boolean}
*/
_hasVaadinListMixin: {
value: true,
},

/**
* If true, the user cannot interact with this element.
* When the element is disabled, the selected item is
Expand Down
11 changes: 8 additions & 3 deletions packages/list-box/test/list-box.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@vaadin/item/vaadin-item.js';
import '../vaadin-list-box.js';

describe('vaadin-list-box', () => {
let listBox;
let listBox, tagName;

beforeEach(() => {
listBox = fixtureSync(`
Expand All @@ -13,9 +13,14 @@ describe('vaadin-list-box', () => {
<vaadin-item>Bar</vaadin-item>
</vaadin-list-box>
`);
tagName = listBox.tagName.toLowerCase();
});

it('should extend list-mixin', () => {
expect(listBox._hasVaadinListMixin).to.be.true;
it('should be defined in custom element registry', () => {
expect(customElements.get(tagName)).to.be.ok;
});

it('should have a valid static "is" getter', () => {
expect(customElements.get(tagName).is).to.equal(tagName);
});
});

0 comments on commit a5fd954

Please sign in to comment.