Skip to content

Commit

Permalink
Merge pull request #258 from xdoo/_#257
Browse files Browse the repository at this point in the history
Erster Polymer Unit Test mit Webcomponent Tester
  • Loading branch information
xdoo authored Mar 15, 2018
2 parents 7ca5a46 + 6de4c2e commit a252409
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,22 @@
<goals>
<goal>exec</goal>
</goals>
</execution>
<!--
<execution>
<id>exec-polymer-test</id>
<phase>test</phase>
<configuration>
<executable>polymer</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
-->
</executions>
</plugin>
</plugins>
Expand Down
43 changes: 43 additions & 0 deletions test/animad-list-header_test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<!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>my-view1</title>

<script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../bower_components/web-component-tester/browser.js"></script>

<!-- Import the element to test -->
<link rel="import" href="../src/common-libs/animad-list-header.html">
</head>
<body>
<test-fixture id="BasicAnimadListHeader">
<template>
<animad-list-header id="basic-animad-list-header"></animad-list-header>
</template>
</test-fixture>

<script>
suite('animad-list-header tests', function() {
test('Test Placeholder Defaults', function() {
var basicAnimadListHeader = fixture('BasicAnimadListHeader');
var searchBar = basicAnimadListHeader.shadowRoot.querySelector('#search-bar');
console.log(searchBar);
assert.equal(basicAnimadListHeader.placeholderSearch, 'Search');
});
});
</script>
</body>
</html>
6 changes: 4 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
<body>
<script>
WCT.loadSuites([
'animad-list-header_test.html?dom=shadow',
'animad-list-header_test.html?wc-shadydom=true'
// Load 'my-view1.html' test suite, using native shadow dom
'my-view1.html?dom=shadow',
//'my-view1.html?dom=shadow',
// Load 'my-view1.html' test suite, using shadydom
'my-view1.html?wc-shadydom=true',
//'my-view1.html?wc-shadydom=true',
]);
</script>
</body>
Expand Down

0 comments on commit a252409

Please sign in to comment.