webkit doesn't focus ranges like inputs

This commit is contained in:
Cory LaViska
2022-06-28 18:01:55 -04:00
parent b2cf3a5505
commit cb7f0aa41e

View File

@@ -1,5 +1,4 @@
import { expect, fixture, html, oneEvent, waitUntil } from '@open-wc/testing';
import sinon from 'sinon';
import { expect, fixture, html, oneEvent } from '@open-wc/testing';
import { serialize } from '../../utilities/form';
import type SlRange from './range';
@@ -16,18 +15,6 @@ describe('<sl-range>', () => {
expect(input.disabled).to.be.true;
});
it('should focus the input when clicking on the label', async () => {
const el = await fixture<SlRange>(html` <sl-range label="Name"></sl-range> `);
const label = el.shadowRoot!.querySelector('[part="form-control-label"]')!;
const submitHandler = sinon.spy();
el.addEventListener('sl-focus', submitHandler);
(label as HTMLLabelElement).click();
await waitUntil(() => submitHandler.calledOnce);
expect(submitHandler).to.have.been.calledOnce;
});
describe('when serializing', () => {
it('should serialize its name and value with FormData', async () => {
const form = await fixture<HTMLFormElement>(html` <form><sl-range name="a" value="1"></sl-range></form> `);