mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
02e924e3c5
commit
05b25af69f
55 changed files with 1554 additions and 907 deletions
|
@ -82,7 +82,7 @@ Notes on Polyfill compatibility in tests:
|
|||
|
||||
suite('x-resizer-parent', function() {
|
||||
|
||||
test('notify resizables from window', function(done) {
|
||||
test('notify resizables from window', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent),
|
||||
ListenForResize(testEl.$.child1a),
|
||||
|
@ -91,22 +91,13 @@ Notes on Polyfill compatibility in tests:
|
|||
ListenForResize(testEl.$.shadow1d.$.resizable)
|
||||
];
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
|
||||
RemoveListeners(listeners);
|
||||
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('notify resizables from parent', function(done) {
|
||||
test('notify resizables from parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent),
|
||||
ListenForResize(testEl.$.child1a),
|
||||
|
@ -115,43 +106,33 @@ Notes on Polyfill compatibility in tests:
|
|||
ListenForResize(testEl.$.shadow1d.$.resizable)
|
||||
];
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
testEl.$.parent.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
testEl.$.parent.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('detach resizables then notify parent', function(done) {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parent),
|
||||
ListenForResize(testEl.$.child1a, false),
|
||||
ListenForResize(testEl.$.child1b),
|
||||
ListenForResize(testEl.$.shadow1c.$.resizable, false),
|
||||
ListenForResize(testEl.$.shadow1d.$.resizable)
|
||||
];
|
||||
test('detach resizables then notify parent', function() {
|
||||
sinon.spy(testEl.$.child1a, 'notifyResize');
|
||||
sinon.spy(testEl.$.shadow1c.$.resizable, 'notifyResize');
|
||||
sinon.spy(testEl.$.child1b, 'notifyResize');
|
||||
sinon.spy(testEl.$.shadow1d.$.resizable, 'notifyResize');
|
||||
|
||||
var el = Polymer.dom(testEl.root).querySelector('#child1a');
|
||||
var firstElementToRemove = testEl.$.child1a;
|
||||
var firstElementParent = Polymer.dom(firstElementToRemove).parentNode;
|
||||
var secondElementToRemove = testEl.$.shadow1c.$.resizable;
|
||||
var secondElementParent = Polymer.dom(secondElementToRemove).parentNode;
|
||||
|
||||
el.parentNode.removeChild(el);
|
||||
el = Polymer.dom(testEl.root).querySelector('#shadow1c');
|
||||
el.parentNode.removeChild(el);
|
||||
Polymer.dom(firstElementParent).removeChild(firstElementToRemove);
|
||||
Polymer.dom(secondElementParent).removeChild(secondElementToRemove);
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
testEl.$.parent.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
Polymer.dom.flush();
|
||||
|
||||
testEl.$.parent.notifyResize();
|
||||
|
||||
expect(testEl.$.child1a.notifyResize.callCount).to.be.equal(0);
|
||||
expect(testEl.$.shadow1c.$.resizable.notifyResize.callCount).to.be.equal(0);
|
||||
expect(testEl.$.child1b.notifyResize.callCount).to.be.equal(1);
|
||||
expect(testEl.$.shadow1d.$.resizable.notifyResize.callCount).to.be.equal(1);
|
||||
});
|
||||
|
||||
test('detach parent then notify window', function(done) {
|
||||
|
@ -183,7 +164,7 @@ Notes on Polyfill compatibility in tests:
|
|||
|
||||
suite('x-resizer-parent-filtered', function() {
|
||||
|
||||
test('notify resizables from window', function(done) {
|
||||
test('notify resizables from window', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a),
|
||||
|
@ -194,19 +175,12 @@ Notes on Polyfill compatibility in tests:
|
|||
|
||||
testEl.$.parentFiltered.active = testEl.$.child2a;
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
window.dispatchEvent(new CustomEvent('resize', { bubbles: false }));
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('notify resizables from parent', function(done) {
|
||||
test('notify resizables from parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a),
|
||||
|
@ -217,19 +191,12 @@ Notes on Polyfill compatibility in tests:
|
|||
|
||||
testEl.$.parentFiltered.active = testEl.$.child2a;
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
|
||||
test('detach resizables then notify parent', function(done) {
|
||||
test('detach resizables then notify parent', function() {
|
||||
var listeners = [
|
||||
ListenForResize(testEl.$.parentFiltered),
|
||||
ListenForResize(testEl.$.child2a, false),
|
||||
|
@ -245,16 +212,9 @@ Notes on Polyfill compatibility in tests:
|
|||
|
||||
testEl.$.parentFiltered.active = testEl.$.shadow2d.$.resizable;
|
||||
|
||||
setTimeout(function() {
|
||||
try {
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
}, 0);
|
||||
testEl.$.parentFiltered.notifyResize();
|
||||
expect(pendingNotifications).to.be.eql(0);
|
||||
RemoveListeners(listeners);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue