Skip to content

Commit 332c167

Browse files
committed
fix(steps): do not throw if there is no step
1 parent 10ebfef commit 332c167

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/steps/src/LionSteps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class LionSteps extends ObserverMixin(LionLitElement) {
7272
hasInitial = true;
7373
}
7474
});
75-
if (!hasInitial) {
75+
if (!hasInitial && this.steps[0]) {
7676
this.steps[0].enter();
7777
}
7878
}

packages/steps/test/lion-steps.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ async function checkWorkflow(steps, expected) {
2727
}
2828

2929
describe('lion-steps', () => {
30+
it('can be instantiated', async () => {
31+
const el = await fixture(html`
32+
<lion-steps> </lion-steps>
33+
`);
34+
expect(el).to.be.a('HTMLElement');
35+
});
36+
3037
it('has "steps" getter that returns default slot elements', async () => {
3138
const el = await fixture(html`
3239
<lion-steps>

0 commit comments

Comments
 (0)