test(core): init stencil core test suite

This commit is contained in:
Adam Bradley
2017-09-26 22:12:36 -05:00
parent ff7b05ed23
commit d3e79fb462
3 changed files with 2962 additions and 96 deletions

View File

@ -0,0 +1,27 @@
import { render, flush } from '@stencil/core/testing';
import { Button } from '../button';
describe('button', () => {
it('should render button inner text', async () => {
const root = await render({
components: [Button],
html: '<ion-button>Button Inner Text</ion-button>'
});
expect(root.textContent).toBe('Button Inner Text');
expect(root.querySelector('button').hasAttribute('disabled')).toBe(false);
root.disabled = true;
await flush(root);
expect(root.querySelector('button').hasAttribute('disabled')).toBe(true);
});
it('should default itemButton to false', () => {
const btn = new Button();
expect(btn.itemButton).toBe(false);
});
});