1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-03-04 22:39:49 -05:00
parent 7dbb1f7535
commit b447272b19
26 changed files with 478 additions and 107 deletions

View file

@ -24,6 +24,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../../iron-iconset/iron-iconset.html">
<link rel="import" href="../../promise-polyfill/promise-polyfill.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="icon-holder.html">
</head>
<body>
@ -61,6 +62,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="SrcIconSwitch">
<template>
<iron-iconset name="example" icons="location blank" src="location.png" size="24" width="48"></iron-iconset>
<iron-icon></iron-icon>
</template>
</test-fixture>
<test-fixture id="ParentForceUpdate">
<template>
<icon-holder>
<iron-icon></iron-icon>
</icon-holder>
</template>
</test-fixture>
<script>
function iconElementFor (node) {
var nodes = Polymer.dom(node.root).childNodes;
@ -143,6 +159,60 @@ suite('<iron-icon>', function() {
});
});
});
suite('when switching between src and icon properties', function() {
var icon;
setup(function() {
var elements = fixture('IconFromIconset');
icon = elements[1];
});
test('will display the icon if both icon and src are set', function() {
icon.src = '../demo/location.png';
icon.icon = 'example:location';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
// Check if it works too it we change the affectation order
icon.icon = 'example:location';
icon.src = '../demo/location.png';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
});
test('will display the icon when src is defined first and then reset', function() {
icon.src = '../demo/location.png';
icon.icon = null;
icon.src = null;
icon.icon = 'example:location';
expect(hasIcon(icon)).to.be.true;
expect(iconElementFor(icon)).to.not.exist;
});
test('will display the src when icon is defined first and then reset', function() {
icon.src = null;
icon.icon = 'example:location';
icon.src = '../demo/location.png';
icon.icon = null;
expect(hasIcon(icon)).to.be.false;
expect(iconElementFor(icon)).to.exist;
});
test('will display nothing if both properties are unset', function() {
icon.src = '../demo/location.png';
icon.icon = 'example:location';
icon.src = null;
icon.icon = null;
expect(hasIcon(icon)).to.be.false;
expect(iconElementFor(icon)).to.not.exist;
});
});
suite('ancestor direct updates', function() {
test('handle properties set before ready', function() {
var holder = fixture('ParentForceUpdate');
});
});
});
</script>