This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wc-tester' into 2way-improved
Conflicts: core-list.css
- Loading branch information
Showing
11 changed files
with
176 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
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
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,2 @@ | ||
var gulp = require('gulp'); | ||
require('gulp-web-component-tester').init(gulp); |
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,5 @@ | ||
{ | ||
"dependencies": { | ||
"gulp": "^3.8.7" | ||
} | ||
} |
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,63 @@ | ||
<!doctype html> | ||
<!-- | ||
Copyright (c) 2014 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 | ||
--> | ||
<html> | ||
<head> | ||
<title>core-list</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
<script src="../../../platform/platform.js"></script> | ||
<script src="../../../polymer-test-tools/chai/chai.js"></script> | ||
<script src="../../../polymer-test-tools/htmltest.js"></script> | ||
<link rel="import" href="../../core-list.html"> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
-webkit-tap-highlight-color: transparent; | ||
overflow: hidden; | ||
} | ||
core-list { | ||
display: block; | ||
height: 100%; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
</head> | ||
<body fit> | ||
|
||
<core-list id="list"> | ||
<template> | ||
<div class="item {{ {selected: selected} | tokenList }}"> | ||
<div class="subject">Row: {{index}}, Record ID: {{model.id}}</div> | ||
<input type="checkbox" checked="{{model.checked}}"> | ||
<input type="number" value="{{model.value}}" class="narrow"> | ||
<select selectedIndex="{{model.type}}"><option>a</option><option>b</option><option>c</option></select> | ||
</div> | ||
</template> | ||
</core-list> | ||
|
||
<script> | ||
document.addEventListener('polymer-ready', function() { | ||
// Test a property | ||
var el = document.querySelector('core-list'); | ||
el.data = [ | ||
{id:123, checked:true, value:99, type:1}, | ||
{id:456, checked:false, value:88, type:2} | ||
]; | ||
el.onMutation(el, function() { | ||
chai.assert(el.children.length == el.data.length + 1, | ||
'children.length should be 1 (template) + count of data elements'); | ||
done(); | ||
}); | ||
|
||
}); | ||
|
||
</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,68 @@ | ||
<!doctype html> | ||
<!-- | ||
Copyright (c) 2014 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 | ||
--> | ||
<html> | ||
<head> | ||
<title>core-list</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | ||
<script src="../../../platform/platform.js"></script> | ||
<script src="../../../polymer-test-tools/chai/chai.js"></script> | ||
<script src="../../../polymer-test-tools/htmltest.js"></script> | ||
<link rel="import" href="../../core-list.html"> | ||
<style> | ||
html, body { | ||
margin: 0; | ||
-webkit-tap-highlight-color: transparent; | ||
overflow: hidden; | ||
} | ||
core-list { | ||
display: block; | ||
height: 100%; | ||
margin: 0 auto; | ||
} | ||
</style> | ||
</head> | ||
<body fit> | ||
|
||
<core-list id="list"> | ||
<template> | ||
<div class="item {{ {selected: selected} | tokenList }}"> | ||
<div class="subject">Row: {{index}}, Record ID: {{model.id}}</div> | ||
<input type="checkbox" checked="{{model.checked}}"> | ||
<input type="number" value="{{model.value}}" class="narrow"> | ||
<select selectedIndex="{{model.type}}"><option>a</option><option>b</option><option>c</option></select> | ||
</div> | ||
</template> | ||
</core-list> | ||
|
||
<script> | ||
document.addEventListener('polymer-ready', function() { | ||
// Test a property | ||
var el = document.querySelector('core-list'); | ||
el.data = [ | ||
{id:123, checked:true, value:99, type:1}, | ||
{id:456, checked:false, value:88, type:2} | ||
]; | ||
el.onMutation(el, function() { | ||
el.data.length = 1; | ||
requestAnimationFrame(function() { | ||
chai.assert(el.children.length == 2 + 1, | ||
'children.length should be 1 (template) + count of data elements'); | ||
chai.assert(el.children[el.children.length-1].getAttribute('hidden') !== null, | ||
'last element shoudl be hidden'); | ||
done(); | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
</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,4 @@ | ||
htmlSuite('core-list', function() { | ||
htmlTest('html/core-list-basic.html'); | ||
htmlTest('html/core-list-delete.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,14 @@ | ||
<!doctype htmlz> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | ||
<title>Web Component Test Runner</title> | ||
<script src="../../polymer-test-tools/ci-support.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
runTests('tests.json'); | ||
</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,6 @@ | ||
{ | ||
"tools": ["chai", "mocha-tdd"], | ||
"tests": [ | ||
"js/htmltests.js" | ||
] | ||
} |