/* eslint-disable lit-a11y/click-events-have-key-events */ import { LionButtonReset } from '@lion/ui/button.js'; import { aTimeout, defineCE, expect, fixture, html, unsafeStatic } from '@open-wc/testing'; import sinon from 'sinon'; export function LionButtonResetSuite({ klass = LionButtonReset } = {}) { const tagStringButtonReset = defineCE(class extends klass {}); const tagButtonReset = unsafeStatic(tagStringButtonReset); describe('LionButtonReset', () => { it('has .type="reset" and type="reset" by default', async () => { const el = /** @type {LionButtonReset} */ ( await fixture(html`<${tagButtonReset}>foo`) ); expect(el.type).to.equal('reset'); expect(el.getAttribute('type')).to.be.equal('reset'); }); /** * Notice functionality below is not purely for type="reset", also for type="submit". * For mainainability purposes the submit functionality is part of LionButtonReset. * (it needs the same logic) * LionButtonReset could therefore actually be considered as 'LionButtonForm' (without the * implicit form submission logic), but LionButtonReset is an easier to grasp name for * Application Developers: for reset buttons, always use LionButtonReset, for submit * buttons always use LionButton. * For buttons that should support all three types (like native