Skip to content

Commit

Permalink
fix: await proper element in resize mixin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Dec 23, 2024
1 parent 41b0dad commit af559e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/component-base/test/resize-mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ describe('resize-mixin', () => {
beforeEach(async () => {
parent.appendChild(element);
// Wait for the initial resize.
await nextResize(element);
await nextResize(parent);
});

it('should notify parent element resize', async () => {
const spy = sinon.spy(element, '_onResize');
parent.style.width = '100px';
await nextResize(element);
await nextResize(parent);
expect(spy.calledOnce).to.be.true;
});

Expand Down Expand Up @@ -109,13 +109,13 @@ describe('resize-mixin', () => {
parent.attachShadow({ mode: 'open' });
parent.shadowRoot.appendChild(element);
// Wait for the initial resize.
await nextResize(element);
await nextResize(parent);
});

it('should notify shadow host resize', async () => {
const spy = sinon.spy(element, '_onResize');
parent.style.width = '100px';
await nextResize(element);
await nextResize(parent);
expect(spy.calledOnce).to.be.true;
});
});
Expand Down

0 comments on commit af559e9

Please sign in to comment.