This commit is contained in:
Cory LaViska
2025-06-05 16:47:34 -04:00
parent 9696b8106d
commit 5501133c64
3 changed files with 6 additions and 6 deletions

View File

@@ -38,8 +38,8 @@ describe('<wa-slider>', () => {
const el = await fixture<WaSlider>(html` <wa-slider disabled></wa-slider> `);
const input = el.shadowRoot!.querySelector<HTMLElement>("[role='slider']")!;
expect(el.matches(":disabled")).to.be.true
expect(input.getAttribute("aria-disabled")).to.equal("true");
expect(el.matches(':disabled')).to.be.true;
expect(input.getAttribute('aria-disabled')).to.equal('true');
});
describe('when the value changes', () => {

View File

@@ -124,7 +124,7 @@ export default class WaSlider extends WebAwesomeFormAssociatedElement {
@state()
set value(val: number | null) {
val = Number(val) ?? null
val = Number(val) ?? null;
if (this._value === val) {
return;
@@ -141,8 +141,8 @@ export default class WaSlider extends WebAwesomeFormAssociatedElement {
@property({ type: Number, attribute: 'max-value' }) maxValue = 50;
/** The default value of the form control. Primarily used for resetting the form control. */
@property({ attribute: 'value', reflect: true, type: Number }) defaultValue: number | null = Number(this.getAttribute('value')) || this.minValue;
@property({ attribute: 'value', reflect: true, type: Number }) defaultValue: number | null =
Number(this.getAttribute('value')) || this.minValue;
/** Converts the slider to a range slider with two thumbs. */
@property({ type: Boolean, reflect: true }) range = false;

View File

@@ -163,7 +163,7 @@ function runAllValidityTests(
const control = await createControl();
expect(control.getForm()).to.equal(null);
// control.setAttribute("form", 'test-form');
control.form = "test-form"
control.form = 'test-form';
await control.updateComplete;
expect(control.getForm()).to.equal(form);
});