Skip to content

Commit

Permalink
Merge pull request PolymerElements#118 from PolymerElements/fix-tests
Browse files Browse the repository at this point in the history
fix shadow dom tests
  • Loading branch information
notwaldorf committed Dec 10, 2015
2 parents e620155 + a3d8562 commit 1841ea5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"web-component-tester": "polymer/web-component-tester#^3.4.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"main": "paper-drawer-panel.html",
Expand Down
4 changes: 3 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
<script>
WCT.loadSuites([
'positioning.html',
'small-devices.html'
'small-devices.html',
'positioning.html?dom=shadow',
'small-devices.html?dom=shadow'
]);
</script>
</body>
Expand Down
13 changes: 5 additions & 8 deletions test/positioning.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>

<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../paper-drawer-panel.html">
</head>
<style>
Expand Down Expand Up @@ -53,8 +50,8 @@
test('drawer is positioned correctly', function(done) {
var f, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

Polymer.Base.async(function() {
var drawerStyle = window.getComputedStyle(drawer);
Expand All @@ -72,13 +69,13 @@
test('right-drawer is positioned correctly', function(done) {
var f, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

Polymer.Base.async(function() {
var drawerStyle = window.getComputedStyle(drawer);
expect(drawerStyle.right).to.be.equal('0px');

try {
expect(drawerStyle.left).to.be.equal('auto');
} catch(e) {
Expand Down
23 changes: 10 additions & 13 deletions test/small-devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>

<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../paper-drawer-panel.html">
</head>
<style>
Expand Down Expand Up @@ -61,8 +58,8 @@
test('drawer is hidden by default', function(done) {
var f, panel, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

f.set('forceNarrow', true);
f._forceNarrowChanged();
Expand All @@ -80,8 +77,8 @@
test('right-drawer is hidden by default', function(done) {
var f, panel, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

f.set('forceNarrow', true);
f._forceNarrowChanged();
Expand All @@ -95,11 +92,11 @@
});
});

test('drawer is can be opened', function(done) {
test('drawer can be opened', function(done) {
var f, panel, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

f.set('forceNarrow', true);
f._forceNarrowChanged();
Expand All @@ -119,8 +116,8 @@
test('right-drawer can be closed', function(done) {
var f, panel, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
drawer = f.$$('#drawer');
main = f.$$('#main');

f.set('forceNarrow', true);
f._forceNarrowChanged();
Expand All @@ -134,7 +131,7 @@
done();
});
});

});
</script>
</body>
Expand Down

0 comments on commit 1841ea5

Please sign in to comment.