Skip to content

Svelte extend not triggered when using render #419

Closed
@EricVanEldik

Description

@EricVanEldik

I'm having an issue when trying to test custom elements (using jsdom) in Svelte.
When I use const result = render(MyComponent, { props: { options: '["v1","v2","v3"]', value: '', multiple: false } }); the component get rendered and all functions work as it should.

However the extend in this part of the code is never executed:

<svelte:options
  customElement={{
    tag: 'atp-select',
    shadow: 'none',
    extend: customElementConstructor => {
      return class extends customElementConstructor {
        constructor() {
          console.log('customElementConstructor called');
          super();
          this.self = this;
        }
      };
    },
  }}
/>

How can I make sure the code int the extend is executed when testing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions