Permalink
Browse files

add integration tests for new element methods

  • Loading branch information...
1 parent 51d6f79 commit aa1d027b1894cf44db676d6d4b68b960abf5e8e1 @christian-bromann christian-bromann committed Nov 4, 2016
Showing with 16 additions and 1 deletion.
  1. +0 −1 .eslintignore
  2. +2 −0 test/.eslintrc
  3. +14 −0 test/fixtures/specs/element.spec.js
View
@@ -1,4 +1,3 @@
build/
examples/
bin/
-./*.js
View
@@ -18,6 +18,8 @@
"chai-expect/no-inner-compare": [2]
},
"globals": {
+ "$": true,
+ "$$": true,
"browser": false,
"browserA": false,
"browserB": false,
@@ -136,4 +136,18 @@ describe('element as first class citizen', () => {
'("#notExisting").')
})
})
+
+ describe('$ and $$ helper methods', () => {
+ it('should provide helper method $ to fetch single element', () => {
+ let header = $('header h1')
+ expect(header.getTagName()).to.be.equal('h1')
+ expect($('header h1').getTagName()).to.be.equal('h1')
+ })
+
+ it('should provide helper method $$ to fetch multiple elements', () => {
+ const colors = ['#ff0000', '#008000', '#ffff00', '#000000', '#800080']
+ $$('.box').forEach((box, i) => expect(box.getCssProperty('background').parsed.hex).to.be.equal(colors[i]))
+ expect(browser.elements('.box').getCssProperty('background').map((c) => c.parsed.hex)).to.be.deep.equal(colors)
+ })
+ })
})

0 comments on commit aa1d027

Please sign in to comment.