-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpouchdb-cluster-sync-element_test.html
55 lines (45 loc) · 1.99 KB
/
pouchdb-cluster-sync-element_test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!doctype 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>pouchdb-cluster-sync-element test</title>
<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/@polymer/test-fixture/test-fixture.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
<script type="module" src="../pouchdb-cluster-sync-element.js"></script>
</head>
<body>
<test-fixture id="BasicTestFixture">
<template>
<pouchdb-cluster-sync-element></pouchdb-cluster-sync-element>
</template>
</test-fixture>
<test-fixture id="ChangedPropertyTestFixture">
<template>
<pouchdb-cluster-sync-element prop1="new-prop1"></pouchdb-cluster-sync-element>
</template>
</test-fixture>
<script type="module">
suite('pouchdb-cluster-sync-element', () => {
test('instantiating the element with default properties works', () => {
const element = fixture('BasicTestFixture');
assert.equal(element.prop1, 'pouchdb-cluster-sync-element');
const elementShadowRoot = element.shadowRoot;
const elementHeader = elementShadowRoot.querySelector('h2');
assert.equal(elementHeader.innerHTML, 'Hello pouchdb-cluster-sync-element!');
});
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>