How to use the @stencil/core/testing.TestWindow function in @stencil/core

To help you get started, we’ve selected a few @stencil/core 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 jagreehal / stencil-how-to-test-components / src / components / testing-updates-aria-property / testing-updates-aria-property.spec.tsx View on Github external
beforeEach(async () => {
      window = new TestWindow();
      element = await window.load({
        components: [TestingUpdatesAriaProperty],
        html: ''
      });
      await window.flush();
    });
github BlazeSoftware / blaze / packages / atoms / src / components / calendar / blaze-calendar.spec.ts View on Github external
it('today button changed date', async (done) => {
    const window = new TestWindow();
    element = await window.load({
      components: [Calendar],
      html: ''
    });
    window.flush();

    element.addEventListener('onSelect', (e) => {
      try {
        expect(e.detail).toBe(new Date().toDateString());
        done();
      } catch (err) {
        done.fail(err);
      }
    });

    element.querySelector('.c-calendar__today').click();
github BlazeSoftware / blaze / packages / atoms / src / components / button / blaze-button.spec.ts View on Github external
it(name, async () => {
        const window = new TestWindow();
        element = await window.load({
          components: [Button],
          html
        });
        window.flush();

        expect(element).toMatchSnapshot();
      });
    };
github rangle / mibank-micro-frontends / mibank-components / src / components / mi-navigation / mi-navigation.spec.ts View on Github external
beforeEach(async () => {
      testWindow = new TestWindow();
      element = await testWindow.load({
        components: [MiNavigation],
        html: ""
      });
    });
github ArkEcosystem / qrcode / src / components / ark-qrcode / ark-qrcode.spec.ts View on Github external
beforeEach(async () => {
      window = new TestWindow();
      element = await window.load({
        components: [ArkQRCode],
        html: ''
      });
    });
github KillerCodeMonkey / stencil-quill / src / components / quill / quill.spec.ts View on Github external
beforeEach(async () => {
      testWindow = new TestWindow();
      element = await testWindow.load({
        components: [QuillComponent],
        html: ''
      });
    });
  });
github jeric17 / arv / src / components / arv-flex / arv-flex.spec.ts View on Github external
beforeEach(async () => {
      testWindow = new TestWindow();
      element = await testWindow.load({
        components: [Flex],
        html: ''
      });
    });
github phodal / phodit / components / header / src / components / phodit-header / phodit-header.spec.ts View on Github external
beforeEach(async () => {
      testWindow = new TestWindow();
      element = await testWindow.load({
        components: [PhoditHeader],
        html: ''
      });
    });
github jeric17 / arv / src / components / arv-button / arv-button.spec.ts View on Github external
beforeEach(async () => {
      testWindow = new TestWindow();
      element = await testWindow.load({
        components: [Button],
        html: ''
      });
    });