Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
YonatanKra committed Feb 13, 2022
1 parent 33a9e12 commit d48d8e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions components/popup/src/vwc-popup-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export class VWCPopupBase extends LitElement {
this.open = false;
}

private sizeObserver = new ResizeObserver(() => {
return this.updatePosition();
});
private sizeObserver = new ResizeObserver(() => {
return this.updatePosition();
});

override connectedCallback(): void {
super.connectedCallback();
Expand All @@ -149,9 +149,9 @@ export class VWCPopupBase extends LitElement {
protected override updated(changes: Map<string, boolean>): void {
super.updated(changes);
if (changes.has('anchor')) {
this.sizeObserver.disconnect();
this.sizeObserver.disconnect();
this.anchorEl = this.getAnchorById();
if(this.anchorEl) this.sizeObserver.observe(this.anchorEl);
if(this.anchorEl) this.sizeObserver.observe(this.anchorEl);
}
this.updatePosition();
}
Expand Down
10 changes: 5 additions & 5 deletions components/popup/test/popup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,19 @@ describe('popup', () => {
textToDomToParent(`<${COMPONENT_NAME} arrow anchor="anchor" open><div>This is my popup</div></${COMPONENT_NAME}>`)
);

actualElement.updatePosition = function () {}
actualElement.updatePosition = function () {console.log('noop');};

await actualElement.updateComplete;
await waitNextTask();

let updatePositionCallCount = 0;
actualElement.updatePosition = function () {
updatePositionCallCount++;
}
};

anchorElement.style.height = '20px';

await waitInterval(10);
await waitNextTask();
expect(updatePositionCallCount).to.equal(1);
});

Expand All @@ -157,7 +157,7 @@ describe('popup', () => {
textToDomToParent(`<${COMPONENT_NAME} arrow anchor="anchor" open><div>This is my popup</div></${COMPONENT_NAME}>`)
);

actualElement.updatePosition = function () {}
actualElement.updatePosition = function () {console.log('noop');};
await actualElement.updateComplete;
await waitNextTask();

Expand All @@ -167,7 +167,7 @@ describe('popup', () => {
let updatePositionCallCount = 0;
actualElement.updatePosition = function () {
updatePositionCallCount++;
}
};

anchorElement.style.height = '20px';

Expand Down

0 comments on commit d48d8e9

Please sign in to comment.