How to use the @stencil/core/testing.flush 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 kristianmandrup / red-elements / packages / red-stencil / playtime / components / common / red-checkbox-set / red-checkbox-set.spec.ts View on Github external
it('should work a first name', async () => {
      element.first = 'Peter';
      await flush(element);
      expect(element.textContent).toEqual('Hello, my name is Peter ');
    });
github code-dimension / stencil-components / src / components / chip / chip.spec.ts View on Github external
it('should show the message and image', async () => {
      element.text = 'A text';
      element.image = 'http://localhost/image.jpg';

      await flush(element);

      expect(element.textContent).toEqual('A text');
      expect(element.getElementsByTagName('img')[0].attributes.getNamedItem('src').value).toEqual('http://localhost/image.jpg');
    });
  });
github fluster / web-social-share / src / components / web-social-share / web-social-share.spec.ts View on Github external
it('should work with both a first and a last name', async () => {
      element.first = 'Peter';
      element.last = 'Parker';
      await flush(element);
      expect(element.textContent.trim()).toEqual('Hello, World! I\'m Peter Parker');
    });
  });
github matteobortolazzo / fast-morph / example / src / components / app-profile / app-profile.spec.ts View on Github external
it('should not render any content if there is not a match', async () => {
      await flush(element);
      expect(element.textContent).toEqual('');
    })