Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
Dave Borowitz | 8cdc76b | 2018-03-26 10:04:27 -0400 | [diff] [blame] | 3 | @license |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 4 | Copyright (C) 2017 The Android Open Source Project |
| 5 | |
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. |
| 8 | You may obtain a copy of the License at |
| 9 | |
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, software |
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | See the License for the specific language governing permissions and |
| 16 | limitations under the License. |
| 17 | --> |
| 18 | <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> |
Tao Zhou | d90e7f4 | 2020-04-29 17:07:14 +0200 | [diff] [blame] | 19 | <meta charset="utf-8"> |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 20 | <title>gr-storage</title> |
Tao Zhou | 8ef16f7 | 2019-11-18 14:14:36 -0800 | [diff] [blame] | 21 | |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 22 | <script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script> |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 23 | |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 24 | <script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-lite.js"></script> |
| 25 | <script src="/components/wct-browser-legacy/browser.js"></script> |
Viktar Donich | 29e1ce5 | 2017-03-28 17:02:44 -0700 | [diff] [blame] | 26 | |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 27 | <test-fixture id="basic"> |
| 28 | <template> |
| 29 | <gr-tooltip-content> |
| 30 | </gr-tooltip-content> |
| 31 | </template> |
| 32 | </test-fixture> |
| 33 | |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 34 | <script type="module"> |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 35 | import '../../../test/common-test-setup.js'; |
| 36 | import './gr-tooltip-content.js'; |
| 37 | import {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js'; |
| 38 | suite('gr-tooltip-content tests', () => { |
| 39 | let element; |
| 40 | setup(() => { |
| 41 | element = fixture('basic'); |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 42 | }); |
Dmitrii Filippov | daf0ec9 | 2020-03-17 11:27:28 +0100 | [diff] [blame] | 43 | |
| 44 | test('icon is not visible by default', () => { |
| 45 | assert.equal(dom(element.root) |
| 46 | .querySelector('iron-icon').hidden, true); |
| 47 | }); |
| 48 | |
| 49 | test('position-below attribute is reflected', () => { |
| 50 | assert.isFalse(element.hasAttribute('position-below')); |
| 51 | element.positionBelow = true; |
| 52 | assert.isTrue(element.hasAttribute('position-below')); |
| 53 | }); |
| 54 | |
| 55 | test('icon is visible with showIcon property', () => { |
| 56 | element.showIcon = true; |
| 57 | assert.equal(dom(element.root) |
| 58 | .querySelector('iron-icon').hidden, false); |
| 59 | }); |
| 60 | }); |
Becky Siegel | c9e4a34 | 2017-03-10 16:37:17 -0800 | [diff] [blame] | 61 | </script> |