/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
import {OlProvider} from '../ol-provider.js';
import {fixture, assert} from '@open-wc/testing';
import {html} from 'lit/static-html.js';
suite('ol-provider', () => {
test('is defined', () => {
const el = document.createElement('ol-provider');
assert.instanceOf(el, OlProvider);
});
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 OlProvider;
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 OlProvider;
await el.updateComplete;
assert.equal(getComputedStyle(el).paddingTop, '16px');
});
});