/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
import {PiePrint} from '../pie-print.js';
import {fixture, html} from '@open-wc/testing';
const assert = chai.assert;
suite('pie-print', () => {
test('is defined', () => {
const el = document.createElement('pie-print');
assert.instanceOf(el, PiePrint);
});
test('renders with default values', async () => {
const el = await fixture(html``);
assert.shadowDom.equal(
el,
`
Hello, World!
`
);
});
test('renders with a set name', async () => {
const el = await fixture(html``);
assert.shadowDom.equal(
el,
`
Hello, Test!
`
);
});
test('handles a click', async () => {
const el = (await fixture(html``)) as PiePrint;
const button = el.shadowRoot!.querySelector('button')!;
button.click();
await el.updateComplete;
assert.shadowDom.equal(
el,
`
Hello, World!
`
);
});
test('styling applied', async () => {
const el = (await fixture(html``)) as PiePrint;
await el.updateComplete;
assert.equal(getComputedStyle(el).paddingTop, '16px');
});
});