kopia lustrzana https://github.com/shoelace-style/shoelace
remove test because we can't reliably suppress retargeted clicks
rodzic
7218a19357
commit
5016d27af7
|
@ -455,7 +455,7 @@ const App = () => (
|
|||
|
||||
### Disabled
|
||||
|
||||
Use the `disabled` attribute to disable a button. Clicks will be suppressed until the disabled state is removed.
|
||||
Use the `disabled` attribute to disable a button.
|
||||
|
||||
```html:preview
|
||||
<sl-button variant="default" disabled>Default</sl-button>
|
||||
|
|
|
@ -68,27 +68,6 @@ describe('<sl-button>', () => {
|
|||
const el = await fixture<SlButton>(html` <sl-button href="some/path" disabled>Button Label</sl-button> `);
|
||||
expect(el.shadowRoot!.querySelector('a[disabled]')).not.to.exist;
|
||||
});
|
||||
|
||||
it('should not bubble up clicks', async () => {
|
||||
const button = await fixture<SlButton>(html` <sl-button disabled>Button Label</sl-button> `);
|
||||
const handleClick = sinon.spy();
|
||||
button.addEventListener('click', handleClick);
|
||||
button.click();
|
||||
|
||||
expect(handleClick).not.to.have.been.called;
|
||||
|
||||
button.shadowRoot!.querySelector('button')!.click();
|
||||
expect(handleClick).not.to.have.been.called;
|
||||
|
||||
const buttonLink = await fixture<SlButton>(html` <sl-button href="some/path" disabled>Button Label</sl-button> `);
|
||||
buttonLink.addEventListener('click', handleClick);
|
||||
buttonLink.click();
|
||||
|
||||
expect(handleClick).not.to.have.been.called;
|
||||
|
||||
buttonLink.shadowRoot!.querySelector('a')!.click();
|
||||
expect(handleClick).not.to.have.been.called;
|
||||
});
|
||||
});
|
||||
|
||||
it('should have title if title attribute is set', async () => {
|
||||
|
|
Ładowanie…
Reference in New Issue