@neogrup/nc-zone-map
Version:
Polymer component to display the zone map
54 lines (43 loc) • 1.66 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
<title>nc-zone-map test</title>
<script src="../../../@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../../wct-browser-legacy/browser.js"></script>
<script type="module" src="../nc-zone-map.js"></script>
</head>
<body>
<test-fixture id="BasicTestFixture">
<template>
<nc-zone-map></nc-zone-map>
</template>
</test-fixture>
<test-fixture id="ChangedPropertyTestFixture">
<template>
<nc-zone-map prop1="new-prop1"></nc-zone-map>
</template>
</test-fixture>
<script type="module">
import '../nc-zone-map.js';
suite('nc-zone-map', () => {
test('instantiating the element with default properties works', () => {
const element = fixture('BasicTestFixture');
assert.equal(element.prop1, 'nc-zone-map');
const elementShadowRoot = element.shadowRoot;
const elementHeader = elementShadowRoot.querySelector('h2');
assert.equal(elementHeader.innerHTML, 'Hello nc-zone-map!');
});
test('setting a property on the element works', () => {
// Create a test fixture
const element = fixture('ChangedPropertyTestFixture');
assert.equal(element.prop1, 'new-prop1');
const elementShadowRoot = element.shadowRoot;
const elementHeader = elementShadowRoot.querySelector('h2');
assert.equal(elementHeader.innerHTML, 'Hello new-prop1!');
});
});
</script>
</body>
</html>