From d30cf62f5027f193323cd9374e52016fc2f041ea Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Mon, 29 Apr 2024 10:55:52 -0400 Subject: [PATCH] compare rounded values --- .../split-panel/split-panel.test.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/split-panel/split-panel.test.ts b/src/components/split-panel/split-panel.test.ts index ea6a2eaf3..66e975631 100644 --- a/src/components/split-panel/split-panel.test.ts +++ b/src/components/split-panel/split-panel.test.ts @@ -130,13 +130,13 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); const divider = getDivider(splitPanel); await dragElement(divider, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels - 30); }); @@ -148,13 +148,13 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); const divider = getDivider(splitPanel); await dragElement(divider, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels); }); @@ -166,14 +166,14 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); splitPanel.snap = `${positionInPixels - 40}px`; const divider = getDivider(splitPanel); await dragElement(divider, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels - 40); }); }); @@ -243,13 +243,13 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); const divider = getDivider(splitPanel); await dragElement(divider, 0, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels - 30); }); @@ -261,13 +261,13 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); const divider = getDivider(splitPanel); await dragElement(divider, 0, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels); }); @@ -279,14 +279,14 @@ describe('', () => { ` ); - const positionInPixels = splitPanel.positionInPixels; + const positionInPixels = Math.round(splitPanel.positionInPixels); splitPanel.snap = `${positionInPixels - 40}px`; const divider = getDivider(splitPanel); await dragElement(divider, 0, -30); - const positionInPixelsAfterDrag = splitPanel.positionInPixels; + const positionInPixelsAfterDrag = Math.round(splitPanel.positionInPixels); expect(positionInPixelsAfterDrag).to.be.equal(positionInPixels - 40); }); });