webdash-readme-preview
Version:
Preview your README.md straight from the dashboard
53 lines (42 loc) • 1.71 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>empty-state-webdash test</title>
<script src="../../webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../empty-state-webdash.html">
</head>
<body>
<test-fixture id="BasicTestFixture">
<template>
<empty-state-webdash></empty-state-webdash>
</template>
</test-fixture>
<test-fixture id="ChangedPropertyTestFixture">
<template>
<empty-state-webdash prop1="new-prop1"></empty-state-webdash>
</template>
</test-fixture>
<script>
suite('empty-state-webdash', () => {
test('instantiating the element with default properties works', () => {
const element = fixture('BasicTestFixture');
assert.equal(element.prop1, 'empty-state-webdash');
const elementShadowRoot = element.shadowRoot;
const elementHeader = elementShadowRoot.querySelector('h2');
assert.equal(elementHeader.innerHTML, 'Hello empty-state-webdash!');
});
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>