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