chore: cleanup old TODOs

This commit is contained in:
qa46hx 2020-04-01 14:11:15 +02:00 committed by Thomas Allmer
parent cf13410026
commit 82f019dc82
5 changed files with 1 additions and 81 deletions

View file

@ -17,7 +17,7 @@
* @property {HTMLElement} contentNode
* @property {boolean} [isModal=false] - sets aria-modal and/or aria-hidden="true" on siblings
* @property {boolean} [isGlobal=false] - determines the connection point in DOM (body vs next
* to invoker). This is what other libraries often refer to as 'portal'. TODO: rename to renderToBody?
* to invoker). This is what other libraries often refer to as 'portal'.
* @property {boolean} [isTooltip=false] - has a totally different interaction- and accessibility pattern from all other overlays, so needed for internals.
* @property {boolean} [handlesUserInteraction] - sets toggle on click, or hover when `isTooltip`
* @property {boolean} [handlesAccessibility] -

View file

@ -148,7 +148,6 @@ export class LionSelectRich extends ScopedElementsMixin(
this.requestUpdate('modelValue');
}
// TODO: quick and dirty fix. Should be possible to do it nicer on a higher layer
get serializedValue() {
return this.modelValue;
}
@ -260,7 +259,6 @@ export class LionSelectRich extends ScopedElementsMixin(
get _inputNode() {
// In FormControl, we get direct child [slot="input"]. This doesn't work, because the overlay
// system wraps it in [slot="_overlay-shadow-outlet"]
// TODO: find a way to solve this by putting the wrapping part in shadow dom...
return this.querySelector('[slot="input"]');
}

View file

@ -401,29 +401,6 @@ describe('lion-select-rich interactions', () => {
});
});
// TODO: nice to have
describe.skip('Read only', () => {
it('can be focused if readonly', async () => {
const el = await fixture(html`
<lion-listbox readonly> </lion-listbox>
`);
expect(el.tabIndex).to.equal('-1');
});
it('cannot be navigated with keyboard if readonly', async () => {
const el = await fixture(html`
<lion-select-rich>
<lion-options slot="input" name="foo">
<lion-option .choiceValue=${10}>Item 1</lion-option>
<lion-option .choiceValue=${20}>Item 2</lion-option>
</lion-options>
</lion-select-rich>
`);
el._listboxNode.dispatchEvent(new KeyboardEvent('keyup', { key: 'ArrowDown' }));
expect(el.choiceValue).to.equal(10);
});
});
describe('Programmatic interaction', () => {
it('can set active state', async () => {
const el = await fixture(html`

View file

@ -484,10 +484,6 @@ export const ValidateMixin = dedupeMixin(
if (typeof this._isEmpty === 'function') {
return this._isEmpty(v);
}
// // TODO: move to compat layer. Be sure to keep this, because people use this a lot
// if (typeof this.__isRequired === 'function') {
// return !this.__isRequired(v);
// }
return (
this.modelValue === null ||
typeof this.modelValue === 'undefined' ||

View file

@ -775,28 +775,6 @@ export function runValidateMixinSuite(customConfig) {
});
describe('State storage and reflection', () => {
class ContainsLowercaseA extends Validator {
constructor(...args) {
super(...args);
this.execute = modelValue => !modelValue.includes('a');
}
static get validatorName() {
return 'ContainsLowercaseA';
}
}
class ContainsLowercaseB extends Validator {
constructor(...args) {
super(...args);
this.execute = modelValue => !modelValue.includes('b');
}
static get validatorName() {
return 'containsLowercaseB';
}
}
it('stores validity of individual Validators in ".validationStates.error[validator.validatorName]"', async () => {
const el = await fixture(html`
<${tag}
@ -890,35 +868,6 @@ export function runValidateMixinSuite(customConfig) {
await el.updateComplete;
expect(spy).to.have.callCount(2);
});
// TODO: what is it used for?
it.skip('fires "error-states-changed" event when "internal" state changes', async () => {
const el = await fixture(html`
<${tag}
.validators=${[new MinLength(3), new ContainsLowercaseA(), new ContainsLowercaseB()]}
>${lightDom}
</${tag}>
`);
const cbError = sinon.spy();
el.addEventListener('error-states-changed', cbError);
el.modelValue = 'a';
await el.updateComplete;
expect(cbError.callCount).to.equal(1);
el.modelValue = 'aa';
await el.updateComplete;
expect(cbError.callCount).to.equal(1);
el.modelValue = 'aaa';
await el.updateComplete;
expect(cbError.callCount).to.equal(2);
el.modelValue = 'aba';
await el.updateComplete;
expect(cbError.callCount).to.equal(3);
});
});
});