This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Make yo polymer:seed structure match seed-element
- Loading branch information
Showing
9 changed files
with
161 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<%= _.slugify(elementName) %> | ||
<%= elementName %> | ||
================ | ||
|
||
See the [component page](http://<%= ghUser %>.github.io/<%= _.slugify(elementName) %>) for more information. | ||
See the [component page](http://<%= ghUser %>.github.io/<%= elementName %>) for more information. | ||
|
||
## Getting Started | ||
|
||
We've put together a [guide for <%= _.slugify(elementName) %>](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling. | ||
We've put together a [guide for <%= elementName %>](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
{ | ||
"name": "<%= _.slugify(elementName) %>", | ||
"name": "<%= elementName %>", | ||
"version": "0.0.0", | ||
"keywords": [ | ||
"seed", | ||
"polymer", | ||
"web-components" | ||
], | ||
"main": "<%= _.slugify(elementName) %>.html", | ||
"main": "<%= elementName %>.html", | ||
"dependencies": { | ||
"polymer": "Polymer/polymer#^0.4.0" | ||
}, | ||
"devDependencies": { | ||
"polymer-test-tools": "Polymer/polymer-test-tools#^0.4.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | ||
<title>Core Elements Test Runner</title> | ||
<meta charset="UTF-8"> | ||
|
||
<script src="../../platform/platform.js"></script> | ||
|
||
<link rel="import" href="tests.html"> | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div id="mocha"></div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | ||
<title><%= elementName %></title> | ||
|
||
<script src="../../platform/platform.js"></script> | ||
<link rel="import" href="../../polymer-test-tools/tools.html"> | ||
<script src="../../polymer-test-tools/htmltest.js"></script> | ||
|
||
<!-- Step 1: import the element to test --> | ||
<link rel="import" href="../<%= elementName %>.html"> | ||
|
||
</head> | ||
<body> | ||
|
||
<<%= elementName %>></<%= elementName %>> | ||
|
||
<script> | ||
|
||
document.addEventListener('polymer-ready', function() { | ||
// Test a property | ||
var myEl = document.querySelector('<%= elementName %>'); | ||
assert.equal(myEl.author, 'Dimitri Glazkov'); | ||
|
||
// Test a method | ||
var hello = myEl.sayHello(); | ||
assert.equal(hello, '<%= elementName %> says, Hello World!'); | ||
var greetings = myEl.sayHello('greetings Earthlings'); | ||
assert.equal(greetings, '<%= elementName %> says, greetings Earthlings'); | ||
|
||
// Test an event | ||
myEl.addEventListener('<%= elementName %>-lasers-success', function(event) { | ||
assert.equal(event.detail.sound, 'Pew pew pew!'); | ||
// IMPORTANT: | ||
// Make sure to call done() at the end of every test suite! | ||
done(); | ||
}); | ||
myEl.fireLasers(); | ||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<link rel="import" href="../../polymer-test-tools/tools.html"> | ||
|
||
<script src="../../polymer-test-tools/mocha-htmltest.js"></script> | ||
|
||
<script> | ||
|
||
mocha.setup({ui: 'tdd', slow: 1000, timeout: 5000, htmlbase: ''}); | ||
|
||
// Below is a set of sample element test suites. | ||
// Replace these with your own suites of tests. | ||
|
||
htmlSuite('<%= elementName %>', function() { | ||
htmlTest('<%= elementName %>-basic.html'); | ||
}); | ||
|
||
// End sample test suites | ||
|
||
mocha.run(); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters