fix(ui): improve test experience in dev-mode

This commit is contained in:
Thijs Louisse 2024-10-30 14:23:20 +01:00 committed by Thijs Louisse
parent 7c2b4692d3
commit 1626dbd460
12 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/ui': patch
---
improve test experience in dev-mode by limiting verbose warnings

View file

@ -369,6 +369,12 @@ export class LionCalendar extends LocalizeMixin(LitElement) {
} }
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** /**
* @private * @private
*/ */

View file

@ -49,6 +49,13 @@ const DisabledWithTabIndexMixinImplementation = superclass =>
} }
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
// @ts-expect-error
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** /**
* @param {number} value * @param {number} value
* @private * @private

View file

@ -152,6 +152,12 @@ const FormControlMixinImplementation = superclass =>
return /** @type {LionValidationFeedback} */ (this.__getDirectSlotChild('feedback')); return /** @type {LionValidationFeedback} */ (this.__getDirectSlotChild('feedback'));
} }
/**
* TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
constructor() { constructor() {
super(); super();

View file

@ -56,6 +56,13 @@ const SyncUpdatableMixinImplementation = superclass =>
this.__SyncUpdatableNamespace.connected = false; this.__SyncUpdatableNamespace.connected = false;
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
// @ts-expect-error
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** /**
* Makes the propertyAccessor.`hasChanged` compatible in synchronous updates * Makes the propertyAccessor.`hasChanged` compatible in synchronous updates
* @param {string} name * @param {string} name

View file

@ -102,6 +102,12 @@ export class LionIcon extends LitElement {
this.__svg = nothing; this.__svg = nothing;
} }
/**
* TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** @param {import('lit').PropertyValues} changedProperties */ /** @param {import('lit').PropertyValues} changedProperties */
update(changedProperties) { update(changedProperties) {
super.update(changedProperties); super.update(changedProperties);

View file

@ -189,6 +189,13 @@ export const OverlayMixinImplementation = superclass =>
} }
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
// @ts-expect-error
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
get _overlayInvokerNode() { get _overlayInvokerNode() {
return /** @type {HTMLElement | undefined} */ ( return /** @type {HTMLElement | undefined} */ (
Array.from(this.children).find(child => child.slot === 'invoker') Array.from(this.children).find(child => child.slot === 'invoker')

View file

@ -93,6 +93,12 @@ export class LionProgressIndicator extends LocalizeMixin(LitElement) {
return !this.hasAttribute('value'); return !this.hasAttribute('value');
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** /**
* In case of a determinate progress-indicator it returns the progress percentage * In case of a determinate progress-indicator it returns the progress percentage
* based on value, min & max. * based on value, min & max.

View file

@ -115,4 +115,10 @@ export class LionStep extends LitElement {
const result = this.condition(data); const result = this.condition(data);
return this.invertCondition ? !result : result; return this.invertCondition ? !result : result;
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
} }

View file

@ -108,6 +108,12 @@ export class LionSteps extends LitElement {
); );
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** /**
* @param {number} newCurrent * @param {number} newCurrent
* @param {number} oldCurrent * @param {number} oldCurrent

View file

@ -188,6 +188,12 @@ export class LionTabs extends LitElement {
); );
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** @private */ /** @private */
__setupSlots() { __setupSlots() {
if (this.shadowRoot) { if (this.shadowRoot) {

View file

@ -55,6 +55,12 @@ export class LionTooltip extends ArrowMixin(OverlayMixin(LitElement)) {
this.invokerRelation = 'description'; this.invokerRelation = 'description';
} }
/**
* // TODO: check if this is a false positive or if we can improve
* @configure ReactiveElement
*/
static enabledWarnings = super.enabledWarnings?.filter(w => w !== 'change-in-update') || [];
/** @protected */ /** @protected */
// eslint-disable-next-line class-methods-use-this // eslint-disable-next-line class-methods-use-this
_defineOverlayConfig() { _defineOverlayConfig() {