Skip to content

Commit

Permalink
test(rounded): implement test for new feature #212
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Jun 20, 2023
1 parent 53d8c5f commit ac2320a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/auro-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* eslint-disable lit/attribute-value-entities */
/* eslint-disable one-var */
/* eslint-disable no-undef */
import { fixture, html, expect } from '@open-wc/testing';
import { fixture, html, expect, elementUpdated } from '@open-wc/testing';
import { AuroButton } from '../src/auro-button.js';
import { registerComponent } from '../index.js';
import '../index.js';

describe('auro-button', () => {
Expand All @@ -30,6 +32,12 @@ describe('auro-button', () => {
expect(classList.includes('auro-button')).to.be.true;
});

it('successfully registers custom component', async () => {
registerComponent('test-button');

expect(typeof customElements.get('test-button')).to.equal(typeof AuroButton);
});

it('tests setting autofocus', async () => {
const el = await fixture(html`
<auro-button autofocus>Click Me!</auro-button>
Expand Down Expand Up @@ -203,4 +211,16 @@ describe('auro-button', () => {

await expect(el).to.be.true;
});

it('default slot is not in DOM when iconOnly attribute is present', async () => {
const el = await fixture(html`
<auro-button rounded iconOnly toggleText>
<auro-icon customSize customcolor category="interface" name="arrow-up" slot="icon"></auro-icon>
</auro-button>
`);

const slotElement = el.querySelector('slot:not([name])');

expect(slotElement).to.equal(null);
});
});

0 comments on commit ac2320a

Please sign in to comment.