my-list-basic.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!doctype html>
  2. <!--
  3. @license
  4. Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
  5. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
  6. The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
  7. The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
  8. Code distributed by Google as part of the polymer project is also
  9. subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
  10. -->
  11. <html>
  12. <head>
  13. <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
  14. <title>my-list-basic</title>
  15. <script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
  16. <script src="../bower_components/web-component-tester/browser.js"></script>
  17. <!-- Import the element to test -->
  18. <link rel="import" href="../elements/my-list/my-list.html">
  19. </head>
  20. <body>
  21. <test-fixture id="basic">
  22. <template>
  23. <my-list></my-list>
  24. </template>
  25. </test-fixture>
  26. <script>
  27. suite('my-list tests', function() {
  28. var list, listItems;
  29. setup(function() {
  30. list = fixture('basic');
  31. });
  32. test('Item lengths should be equalled', function(done) {
  33. // Test a property
  34. // TODO: Fix list.items.push('Foo') causing a WeakMap exception
  35. // Invalid value used as weak map key
  36. list.items = [
  37. 'Responsive Web App boilerplate',
  38. 'Iron Elements and Paper Elements',
  39. 'End-to-end Build Tooling (including Vulcanize)',
  40. 'Unit testing with Web Component Tester',
  41. 'Routing with Page.js',
  42. 'Offline support with the Platinum Service Worker Elements'
  43. ];
  44. // Data bindings will stamp out new DOM asynchronously
  45. // so wait to check for updates
  46. flush(function() {
  47. listItems = list.querySelectorAll('li');
  48. assert.equal(list.items.length, listItems.length);
  49. done();
  50. });
  51. })
  52. });
  53. </script>
  54. </body>
  55. </html>