fix(steps): do not throw if there is no step

This commit is contained in:
Thomas Allmer 2019-11-01 17:54:35 +01:00 committed by Thomas Allmer
parent 10ebfef708
commit 332c16715f
2 changed files with 8 additions and 1 deletions

View file

@ -72,7 +72,7 @@ export class LionSteps extends ObserverMixin(LionLitElement) {
hasInitial = true; hasInitial = true;
} }
}); });
if (!hasInitial) { if (!hasInitial && this.steps[0]) {
this.steps[0].enter(); this.steps[0].enter();
} }
} }

View file

@ -27,6 +27,13 @@ async function checkWorkflow(steps, expected) {
} }
describe('lion-steps', () => { describe('lion-steps', () => {
it('can be instantiated', async () => {
const el = await fixture(html`
<lion-steps> </lion-steps>
`);
expect(el).to.be.a('HTMLElement');
});
it('has "steps" getter that returns default slot elements', async () => { it('has "steps" getter that returns default slot elements', async () => {
const el = await fixture(html` const el = await fixture(html`
<lion-steps> <lion-steps>