mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -1,14 +1,11 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
<!DOCTYPE html><!--
|
||||
Copyright (c) 2014 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
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
--><html><head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>paper-input tests</title>
|
||||
|
@ -21,8 +18,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
'paper-textarea.html',
|
||||
'paper-input-container.html',
|
||||
'paper-input-error.html',
|
||||
'paper-input-char-counter.html'
|
||||
'paper-input-char-counter.html',
|
||||
'paper-input.html?dom=shadow',
|
||||
'paper-textarea.html?dom=shadow',
|
||||
'paper-input-container.html?dom=shadow',
|
||||
'paper-input-error.html?dom=shadow',
|
||||
'paper-input-char-counter.html?dom=shadow'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
</body></html>
|
||||
|
|
|
@ -19,11 +19,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../../iron-input/iron-input.html">
|
||||
<link rel="import" href="../paper-input-container.html">
|
||||
<link rel="import" href="../paper-input-char-counter.html">
|
||||
|
|
|
@ -14,16 +14,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../../iron-input/iron-input.html">
|
||||
<link rel="import" href="../paper-input-container.html">
|
||||
<link rel="import" href="letters-only.html">
|
||||
|
@ -40,6 +37,26 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="prefix">
|
||||
<template>
|
||||
<paper-input-container>
|
||||
<div prefix>$</div>
|
||||
<label id="l">label</label>
|
||||
<input is="iron-input" id="i">
|
||||
</paper-input-container>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="prefix-has-value">
|
||||
<template>
|
||||
<paper-input-container>
|
||||
<div prefix>$</div>
|
||||
<label id="l">label</label>
|
||||
<input is="iron-input" id="i" value="foo">
|
||||
</paper-input-container>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="has-value">
|
||||
<template>
|
||||
<paper-input-container>
|
||||
|
@ -119,9 +136,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(getComputedStyle(container.querySelector('#l')).visibility, 'visible', 'label has visibility:visible');
|
||||
});
|
||||
|
||||
test('label is floated if value is initialized to not null', function() {
|
||||
test('label is floated if value is initialized to not null', function(done) {
|
||||
var container = fixture('has-value');
|
||||
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
|
||||
requestAnimationFrame(function() {
|
||||
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('label is invisible if no-label-float and value is initialized to not null', function() {
|
||||
|
@ -132,7 +152,36 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
test('label is floated if always-float-label is true', function() {
|
||||
var container = fixture('always-float');
|
||||
assert.notEqual(getTransform(container.querySelector('#l')), 'none', 'label has transform');
|
||||
})
|
||||
});
|
||||
|
||||
test('label is floated correctly with a prefix', function(done) {
|
||||
var container = fixture('prefix');
|
||||
var label = Polymer.dom(container).querySelector('#l');
|
||||
var input = Polymer.dom(container).querySelector('#i');
|
||||
|
||||
// Label is initially visible.
|
||||
assert.equal(getComputedStyle(label).visibility, 'visible', 'label has visibility:visible');
|
||||
|
||||
// After entering text, the label floats, and it is not indented.
|
||||
input.bindValue = 'foobar';
|
||||
requestAnimationFrame(function() {
|
||||
assert.notEqual(getTransform(label), 'none', 'label has transform');
|
||||
assert.equal(label.getBoundingClientRect().left, container.getBoundingClientRect().left);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('label is floated correctly with a prefix and prefilled value', function(done) {
|
||||
var container = fixture('prefix-has-value');
|
||||
var label = Polymer.dom(container).querySelector('#l');
|
||||
|
||||
// The label floats, and it is not indented.
|
||||
requestAnimationFrame(function() {
|
||||
assert.notEqual(getTransform(label), 'none', 'label has transform');
|
||||
assert.equal(label.getBoundingClientRect().left, container.getBoundingClientRect().left);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -14,14 +14,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../../iron-input/iron-input.html">
|
||||
<link rel="import" href="../paper-input-container.html">
|
||||
<link rel="import" href="../paper-input-error.html">
|
||||
|
|
|
@ -14,17 +14,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../paper-input.html">
|
||||
<link rel="import" href="letters-only.html">
|
||||
|
||||
|
@ -37,6 +34,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="has-tabindex">
|
||||
<template>
|
||||
<paper-input tabindex="0"></paper-input>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="label">
|
||||
<template>
|
||||
<paper-input label="foo"></paper-input>
|
||||
|
@ -211,7 +214,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
});
|
||||
|
||||
|
||||
suite('validation', function() {
|
||||
|
||||
test('invalid attribute updated after calling validate()', function() {
|
||||
|
@ -255,6 +257,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(input.inputElement.getAttribute('aria-describedby'), Polymer.dom(input.root).querySelector('paper-input-error').id + ' ' + Polymer.dom(input.root).querySelector('paper-input-char-counter').id, 'aria-describedby points to the error message and character counter');
|
||||
});
|
||||
|
||||
test('focus an input with tabindex', function(done) {
|
||||
var input = fixture('has-tabindex');
|
||||
flush(function() {
|
||||
MockInteractions.focus(input);
|
||||
flush(function() {
|
||||
assert.equal(input.shadowRoot ? input.shadowRoot.activeElement :
|
||||
document.activeElement, input._focusableElement);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -14,19 +14,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<script src="../../iron-test-helpers/test-helpers.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../paper-textarea.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -36,6 +32,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="has-tabindex">
|
||||
<template>
|
||||
<paper-textarea tabindex="0"></paper-textarea>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="label">
|
||||
<template>
|
||||
<paper-textarea label="foo"></paper-textarea>
|
||||
|
@ -128,7 +130,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
var inputContent = Polymer.dom(container.root).querySelector('.input-content');
|
||||
assert.isTrue(inputContent.classList.contains('label-is-floating'), 'label is floating');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('focus/blur events', function() {
|
||||
|
@ -155,6 +156,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.isTrue(nBlurEvents >= 1, 'blur event fired')
|
||||
});
|
||||
|
||||
test('focus a textarea with tabindex', function(done) {
|
||||
var input = fixture('has-tabindex');
|
||||
flush(function() {
|
||||
assert.notEqual(document.activeElement, input._focusableElement);
|
||||
MockInteractions.focus(input);
|
||||
setTimeout(function() {
|
||||
assert.equal(document.activeElement, input.shadowRoot ? input : input._focusableElement);
|
||||
done();
|
||||
}, 1);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
suite('a11y', function() {
|
||||
|
@ -186,7 +198,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(input.inputElement.textarea.getAttribute('aria-describedby'), Polymer.dom(input.root).querySelector('paper-input-error').id + ' ' + Polymer.dom(input.root).querySelector('paper-input-char-counter').id, 'aria-describedby points to the error message and character counter');
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue