forked from vaadin/vaadin-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vaadin#13 from vaadin/feature/value
Enabled selecting an item from a static list (fixes vaadin#10)
- Loading branch information
Showing
5 changed files
with
116 additions
and
15 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
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,64 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>vaadin-combo basic tests</title> | ||
<script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script> | ||
<script src="../bower_components/web-component-tester/browser.js"></script> | ||
<script src="../bower_components/test-fixture/test-fixture-mocha.js"></script> | ||
|
||
<link rel="import" href="common.html"> | ||
</head> | ||
|
||
<body> | ||
|
||
<test-fixture id="combobox"> | ||
<template> | ||
<vaadin-combo-box></vaadin-combo-box> | ||
</template> | ||
</test-fixture> | ||
|
||
|
||
<script> | ||
describe('selecting a value', function() { | ||
var combobox; | ||
var input; | ||
var selector; | ||
|
||
beforeEach(function() { | ||
combobox = fixture('combobox'); | ||
input = combobox.$$("input"); | ||
selector = combobox.$.selector; | ||
}); | ||
|
||
it('should select by using the text input', function() { | ||
input.bindValue = "foo"; | ||
expect(combobox.value).to.equal("foo"); | ||
expect(selector.selected).to.equal("foo"); | ||
}); | ||
|
||
it('should select by using the selector', function() { | ||
selector.selected = "foo"; | ||
expect(combobox.value).to.equal("foo"); | ||
expect(input.bindValue).to.equal("foo"); | ||
}); | ||
|
||
it('should select by using JS api', function() { | ||
combobox.value = "foo"; | ||
expect(selector.selected).to.equal("foo"); | ||
expect(input.bindValue).to.equal("foo"); | ||
}); | ||
|
||
it('should close the dropdown on selection', function() { | ||
combobox.open(); | ||
combobox.value = "foo"; | ||
expect(combobox.opened).to.equal(false); | ||
}); | ||
|
||
}); | ||
</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