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
13
<meta charset="UTF-8">
14
<title>paper-drawer-panel tests</title>
15
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
17
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
18
<script src="../../web-component-tester/browser.js"></script>
19
<link rel="import" href="../paper-drawer-panel.html">
29
<test-fixture id="left-drawer">
38
<test-fixture id="right-drawer">
40
<paper-drawer-panel right-drawer>
48
suite('positioning', function() {
50
test('drawer is positioned correctly', function(done) {
52
f = fixture('left-drawer');
53
drawer = f.$$('#drawer');
56
Polymer.Base.async(function() {
57
var drawerStyle = window.getComputedStyle(drawer);
58
expect(drawerStyle.left).to.be.equal('0px');
60
expect(drawerStyle.right).to.be.equal('auto');
63
expect(drawerStyle.right).to.be.equal(f.offsetWidth - drawer.offsetWidth + 'px');
69
test('right-drawer is positioned correctly', function(done) {
71
f = fixture('right-drawer');
72
drawer = f.$$('#drawer');
75
Polymer.Base.async(function() {
76
var drawerStyle = window.getComputedStyle(drawer);
77
expect(drawerStyle.right).to.be.equal('0px');
80
expect(drawerStyle.left).to.be.equal('auto');
83
expect(drawerStyle.left).to.be.equal(f.offsetWidth - drawer.offsetWidth + 'px');