mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
webkit doesn't focus ranges like inputs
This commit is contained in:
@@ -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> `);
|
||||
|
||||
Reference in New Issue
Block a user