mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
Added title attribute (#1043)
* added title attribute Fixes #1042 * added tests for title * also some other tests * clarify why title was added
This commit is contained in:
committed by
GitHub
parent
31e1f2fc59
commit
35aa56d334
@@ -23,6 +23,7 @@ describe('<sl-button>', () => {
|
||||
it('default values are set correctly', async () => {
|
||||
const el = await fixture<SlButton>(html` <sl-button>Button Label</sl-button> `);
|
||||
|
||||
expect(el.title).to.equal('');
|
||||
expect(el.variant).to.equal('default');
|
||||
expect(el.size).to.equal('medium');
|
||||
expect(el.disabled).to.equal(false);
|
||||
@@ -88,6 +89,13 @@ describe('<sl-button>', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should have title if title attribute isset', async () => {
|
||||
const el = await fixture<SlButton>(html` <sl-button title="Test"></sl-button> `);
|
||||
const button = el.shadowRoot!.querySelector<HTMLButtonElement>('[part~="base"]')!;
|
||||
|
||||
expect(button.title).to.equal('Test');
|
||||
});
|
||||
|
||||
describe('when loading', () => {
|
||||
it('should have a spinner present', async () => {
|
||||
const el = await fixture<SlButton>(html` <sl-button loading>Button Label</sl-button> `);
|
||||
|
||||
Reference in New Issue
Block a user