mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update guide
This commit is contained in:
parent
7fbb1924d0
commit
9bbb9ecfb9
17 changed files with 291 additions and 56 deletions
|
@ -1,5 +1,6 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
|
@ -23,6 +24,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="test-validatable.html">
|
||||
<link rel="import" href="cats-only.html">
|
||||
<link rel="import" href="dogs-only.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
@ -33,6 +36,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="validators">
|
||||
<template>
|
||||
<cats-only></cats-only>
|
||||
<dogs-only></dogs-only>
|
||||
<test-validatable></test-validatable>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('basic', function() {
|
||||
|
@ -51,6 +62,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.isTrue(valid);
|
||||
});
|
||||
|
||||
test('changing the validator works', function() {
|
||||
var node = fixture('validators');
|
||||
var input = node[2];
|
||||
|
||||
// Initially there's no validator, so everything is valid.
|
||||
assert.isTrue(input.validate(''));
|
||||
assert.isTrue(input.validate('cats'));
|
||||
|
||||
// Only valid if the value is 'cats'.
|
||||
input.validator = 'cats-only';
|
||||
assert.isFalse(input.validate('ca'));
|
||||
assert.isTrue(input.validate('cats'));
|
||||
|
||||
// Only valid if the value is 'dogs'.
|
||||
input.validator = 'dogs-only';
|
||||
assert.isFalse(input.validate('cats'));
|
||||
assert.isTrue(input.validate('dogs'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue