-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-element.test.html
38 lines (29 loc) · 1.13 KB
/
simple-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
<script src="../bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="./simple-element.html">
<test-fixture id="BasicTestFixture">
<template>
<simple-element></simple-element>
</template>
</test-fixture>
<test-fixture id="ChangedPropertyTestFixture">
<template>
<simple-element title="fixture"></simple-element>
</template>
</test-fixture>
<script>
suite("simple-element", () => {
test("instantiate the element with default properties", () => {
const element = fixture("BasicTestFixture")
expect(element.title).to.equal("simple-element")
const elementHeader = element.shadowRoot.querySelector("h2")
expect(elementHeader.innerHTML).to.equal("Hello simple-element!")
})
test("set a property on the element", () => {
const element = fixture("ChangedPropertyTestFixture")
expect(element.title).to.equal("fixture")
const elementHeader = element.shadowRoot.querySelector("h2")
expect(elementHeader.innerHTML).to.equal("Hello fixture!")
})
})
</script>