Home | History | Annotate | Download | only in test
      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 
     14     <title>paper-menu tests</title>
     15 
     16     <meta charset="utf-8">
     17     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     18     <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
     19 
     20     <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
     21 
     22     <script src="../../web-component-tester/browser.js"></script>
     23     <link rel="import" href="../paper-menu.html">
     24 
     25   </head>
     26   <body>
     27 
     28     <test-fixture id="basic">
     29       <template>
     30         <paper-menu>
     31           <div>item 1</div>
     32           <div>item 2</div>
     33           <div>item 3</div>
     34         </paper-menu>
     35       </template>
     36     </test-fixture>
     37 
     38     <script>
     39 
     40       suite('<paper-menu>', function() {
     41         var menu;
     42 
     43         setup(function() {
     44           menu = fixture('basic');
     45         });
     46 
     47         test('selected item is styled', function() {
     48 
     49           var boldDiv = document.createElement('div');
     50           boldDiv.style.fontWeight = 'bold';
     51           document.body.appendChild(boldDiv);
     52 
     53           menu.selected = 1;
     54 
     55           assert.equal(getComputedStyle(menu.selectedItem).fontWeight,
     56               getComputedStyle(boldDiv).fontWeight, 'selected item is bold');
     57         });
     58 
     59       });
     60 
     61     </script>
     62 
     63   </body>
     64 </html>
     65