-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init the vaadin-button element with a native button
- Loading branch information
Limon Monte
committed
Feb 17, 2017
1 parent
dd791a4
commit be9be2b
Showing
28 changed files
with
476 additions
and
87 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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"html" | ||
], | ||
"globals": { | ||
"Polymer": false | ||
"Polymer": false, | ||
"Vaadin": false | ||
} | ||
} |
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 |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
--> | ||
```html | ||
<vaadin-button> | ||
... | ||
Vaadin Button | ||
</vaadin-button> | ||
``` | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"fixture": false, | ||
"it": false, | ||
"expect": false, | ||
"gemini": false | ||
"gemini": false, | ||
"MockInteractions": false | ||
} | ||
} |
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,89 @@ | ||
<!doctype html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>vaadin-button tests</title> | ||
|
||
<script src="../../web-component-tester/browser.js"></script> | ||
<link rel="import" href="../vaadin-button.html"> | ||
|
||
</head> | ||
|
||
<body> | ||
<test-fixture id="default"> | ||
<template> | ||
<vaadin-button>Button</vaadin-button> | ||
</template> | ||
</test-fixture> | ||
|
||
<test-fixture id="disabled"> | ||
<template> | ||
<vaadin-button disabled>Disabled button</vaadin-button> | ||
</template> | ||
</test-fixture> | ||
|
||
<script> | ||
|
||
describe('control-state behavior', function() { | ||
var customElement, focusElement; | ||
|
||
beforeEach(function() { | ||
customElement = fixture('default'); | ||
// Need the shadow dom be rendered before getting the internal element reference | ||
focusElement = customElement.focusElement; | ||
}); | ||
|
||
describe('tabindex', function() { | ||
it('setting tabIndex should forward the value to the internal element', function() { | ||
customElement.tabIndex = 1; | ||
expect(focusElement.getAttribute('tabindex')).to.be.equal('1'); | ||
}); | ||
|
||
it('we always need a tabindex by default', function() { | ||
expect(customElement.getAttribute('tabindex')).to.be.equal('0'); | ||
}); | ||
|
||
it('setting tabIndex should update the attribute', function() { | ||
customElement.tabIndex = 1; | ||
expect(customElement.getAttribute('tabindex')).to.be.equal('1'); | ||
}); | ||
|
||
it('enabling the element should restore old tabindex', function() { | ||
customElement.tabIndex = 1; | ||
customElement.disabled = true; | ||
customElement.disabled = false; | ||
expect(customElement.getAttribute('tabindex')).to.be.equal('1'); | ||
}); | ||
|
||
it('setting disabled to true should remove tabindex', function() { | ||
customElement.tabIndex = 1; | ||
customElement.disabled = true; | ||
expect(customElement.getAttribute('tabindex')).to.not.be.ok; | ||
}); | ||
|
||
it('should synchronize tabindex with tabIndex', function() { | ||
customElement.tabindex = 1; | ||
expect(customElement.tabIndex).to.eql(1); | ||
}); | ||
}); | ||
|
||
describe('disabled', function() { | ||
beforeEach(function() { | ||
customElement = fixture('disabled'); | ||
focusElement = customElement.focusElement; | ||
}); | ||
|
||
it('should not have tabindex if disabled when ready', function() { | ||
expect(customElement.getAttribute('tabindex')).to.not.be.ok; | ||
}); | ||
|
||
it('should update internal element tabIndex', function() { | ||
customElement.tabIndex = 4; | ||
expect(customElement.getAttribute('tabindex')).to.be.null; | ||
expect(focusElement.getAttribute('tabindex')).to.be.equal('4'); | ||
}); | ||
}); | ||
|
||
}); | ||
</script> | ||
</body> |
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,3 @@ | ||
[ | ||
{"name": "index.html", "threshold": 0.75} | ||
] |
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,14 @@ | ||
<!DOCTYPE html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>vaadin-button performance test</title> | ||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../../polymer/polymer.html"> | ||
<link rel="import" href="../../vaadin-button.html"> | ||
</head> | ||
|
||
<body> | ||
<vaadin-button>Vaadin Button</vaadin-button> | ||
</body> |
Oops, something went wrong.