This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: polymer-cli doesn't fail build on failed tests
* Add caching * Tests now run for the shadow dom as well as the shady dom
- Loading branch information
Nick Woodward
committed
Oct 6, 2016
1 parent
2f36b72
commit 1e3d0c4
Showing
6 changed files
with
131 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{package.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!doctype html> | ||
|
||
<html> | ||
<head> | ||
<title>salte-rating basic tests</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | ||
|
||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<script src="../../web-component-tester/browser.js"></script> | ||
|
||
<link rel="import" href="../salte-rating.html"> | ||
|
||
</head> | ||
<body> | ||
|
||
<test-fixture id="rating"> | ||
<template> | ||
<salte-rating></salte-rating> | ||
</template> | ||
</test-fixture> | ||
|
||
<script> | ||
describe('Basic features', function() { | ||
var rating; | ||
|
||
beforeEach(function() { | ||
rating = fixture('rating'); | ||
}); | ||
|
||
it('instantiating the element works', function() { | ||
expect(rating.is).to.be.equal('salte-rating'); | ||
}); | ||
|
||
it('displays 5 rating items', function() { | ||
Polymer.dom.flush(); | ||
|
||
expect(Polymer.dom(rating.root).querySelectorAll('.item').length).to.be.equal(5); | ||
}); | ||
|
||
it('displays 10 rating items', function(done) { | ||
Polymer.dom.flush(); | ||
|
||
rating.set('limit', 10); | ||
|
||
flush(function() { | ||
expect(Polymer.dom(rating.root).querySelectorAll('.item').length).to.be.equal(10); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('updates width to display rating correctly', function() { | ||
Polymer.dom.flush(); | ||
|
||
rating.set('value', 1); | ||
|
||
var icons = Polymer.dom(rating.root).querySelectorAll('.item-icon'); | ||
expect(icons.length).to.be.equal(5); | ||
expect(icons[0].style.width).to.be.equal('100%'); | ||
expect(icons[1].style.width).to.be.equal('0%'); | ||
expect(icons[2].style.width).to.be.equal('0%'); | ||
expect(icons[3].style.width).to.be.equal('0%'); | ||
expect(icons[4].style.width).to.be.equal('0%'); | ||
}); | ||
|
||
it('updates width to display rating correctly - external value', function(done) { | ||
rating.set('value', 2); | ||
flush(function() { | ||
var icons = Polymer.dom(rating.root).querySelectorAll('.item-icon');; | ||
expect(icons.length).to.be.equal(5); | ||
expect(icons[0].style.width).to.be.equal('100%'); | ||
expect(icons[1].style.width).to.be.equal('100%'); | ||
expect(icons[2].style.width).to.be.equal('0%'); | ||
expect(icons[3].style.width).to.be.equal('0%'); | ||
expect(icons[4].style.width).to.be.equal('0%'); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('rate gets called when a rating item is clicked', function(done) { | ||
Polymer.dom.flush(); | ||
|
||
rating.addEventListener('rate', function(e) { | ||
expect(e.detail.rating).to.be.equal(1); | ||
done(); | ||
}); | ||
|
||
Polymer.dom(rating.root).querySelector('.item-icon').click(); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters