Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
move tests from core-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Sep 9, 2014
1 parent fb941db commit 0898920
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#master"
},
"devDependencies": {
"polymer-test-tools": "Polymer/polymer-test-tools#master"
}
}
43 changes: 43 additions & 0 deletions tests/html/core-ajax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!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-ajax</title>

<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-ajax.html">

</head>
<body>

<core-ajax
url="http://gdata.youtube.com/feeds/api/videos/"
params='{"alt":"json", "q":"chrome"}'
handleAs="json"
auto></core-ajax>

<script>

document.addEventListener('polymer-ready', function() {
var assert = chai.assert;
var ajax = document.querySelector('core-ajax');
ajax.addEventListener("core-response", function(event) {
assert.isTrue(event.detail.response.feed.entry.length > 0);
done();
});
});

</script>

</body>
</html>
3 changes: 3 additions & 0 deletions tests/js/htmltests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
htmlSuite('core-ajax', function() {
htmlTest('html/core-ajax.html');
});
14 changes: 14 additions & 0 deletions tests/runner.html
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>
6 changes: 6 additions & 0 deletions tests/tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tools": ["chai", "mocha-tdd"],
"tests": [
"js/htmltests.js"
]
}

0 comments on commit 0898920

Please sign in to comment.