Skip to content

Commit

Permalink
pass element to nextResize
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Dec 23, 2024
1 parent 22886b8 commit 925869b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/component-base/test/resize-mixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ describe('resize-mixin', () => {
beforeEach(async () => {
element = fixtureSync(`<resize-mixin-element></resize-mixin-element>`);
// Wait for the initial resize.
await nextResize();
await nextResize(element);
});

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

Expand All @@ -63,14 +63,13 @@ describe('resize-mixin', () => {
beforeEach(async () => {
parent.appendChild(element);
// Wait for the initial resize.
await nextResize();
// await nextResize();
await nextResize(element);
});

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

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

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

0 comments on commit 925869b

Please sign in to comment.