mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
6825ae319e
commit
2d53ff29c5
106 changed files with 3070 additions and 1567 deletions
|
@ -133,6 +133,43 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
expect(dropdownMenu.selectedItem).to.be.equal(null);
|
||||
});
|
||||
});
|
||||
|
||||
suite('validation', function() {
|
||||
test('a non required dropdown is valid regardless of its selection', function() {
|
||||
var dropdownMenu = fixture('TrivialDropdownMenu');
|
||||
menu = Polymer.dom(dropdownMenu).querySelector('.dropdown-content');
|
||||
|
||||
// no selection.
|
||||
expect(dropdownMenu.validate()).to.be.true;
|
||||
expect(dropdownMenu.invalid).to.be.false;
|
||||
expect(dropdownMenu.value).to.not.be.ok;
|
||||
|
||||
// some selection.
|
||||
menu.selected = 1;
|
||||
expect(dropdownMenu.validate()).to.be.true;
|
||||
expect(dropdownMenu.invalid).to.be.false;
|
||||
expect(dropdownMenu.value).to.be.equal('Bar');
|
||||
});
|
||||
|
||||
test('a required dropdown is invalid without a selection', function() {
|
||||
var dropdownMenu = fixture('TrivialDropdownMenu');
|
||||
dropdownMenu.required = true;
|
||||
|
||||
// no selection.
|
||||
expect(dropdownMenu.validate()).to.be.false;
|
||||
expect(dropdownMenu.invalid).to.be.true;
|
||||
expect(dropdownMenu.value).to.not.be.ok;
|
||||
});
|
||||
|
||||
test('a required dropdown is valid with a selection', function() {
|
||||
var dropdownMenu = fixture('PreselectedDropdownMenu');
|
||||
dropdownMenu.required = true;
|
||||
|
||||
expect(dropdownMenu.validate()).to.be.true;
|
||||
expect(dropdownMenu.invalid).to.be.false;
|
||||
expect(dropdownMenu.value).to.be.equal('Bar');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue