How to use the @open-wc/testing-helpers.fixtureSync function in @open-wc/testing-helpers

To help you get started, we’ve selected a few @open-wc/testing-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github corpusculejs / corpuscule / packages / element / __tests__ / element.ts View on Github external
public [propertyChangedCallback](...args: unknown[]): void {
          propertyChangedCallbackSpy(...args);
        }

        public [internalChangedCallback](...args: unknown[]): void {
          internalChangedCallbackSpy(...args);
        }

        protected [render](): null {
          return null;
        }
      }

      await customElements.whenDefined(tag);

      const test = fixtureSync(`<${tag}>`);

      test.attributeChangedCallback('attr', 'old', 'new');
      test[propertyChangedCallback]('attr', 'old', 'new');
      test[internalChangedCallback]('attr', 'old', 'new');

      await test.updateComplete;

      expect(attributeChangedCallbackSpy).not.toHaveBeenCalled();
      expect(propertyChangedCallbackSpy).not.toHaveBeenCalled();
      expect(internalChangedCallbackSpy).not.toHaveBeenCalled();
      // only during the connection
      expect(schedulerSpy).toHaveBeenCalledTimes(1);
    });
github corpusculejs / corpuscule / packages / styles / __tests__ / index.ts View on Github external
const createSimpleElement = (cls: Constructor): T => {
  const tag = defineCE(cls);

  return fixtureSync(`<${tag}>`);
};