compare rounded values

This commit is contained in:
Cory LaViska
2024-04-29 10:55:52 -04:00
parent 6aa641bb33
commit d30cf62f50

View File

@@ -130,13 +130,13 @@ describe('<wa-split-panel>', () => {
</wa-split-panel>`
);
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('<wa-split-panel>', () => {
</wa-split-panel>`
);
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('<wa-split-panel>', () => {
</wa-split-panel>`
);
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('<wa-split-panel>', () => {
</wa-split-panel>`
);
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('<wa-split-panel>', () => {
</wa-split-panel>`
);
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('<wa-split-panel>', () => {
</wa-split-panel>`
);
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);
});
});