Skip to content

Commit

Permalink
fix: RtlScrollConverter test on high dpi systems in fast-web-utilities (
Browse files Browse the repository at this point in the history
#6857)

* fix RtlScrollConverter test for high dpi systems

- Adjusts the scrollLeft check to consider the devicePixelRatio

* Change files
  • Loading branch information
radium-v authored Nov 8, 2023
1 parent 0eb5c61 commit a7a3c89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "fix RtlScrollConverter test for high dpi systems",
"packageName": "@microsoft/fast-web-utilities",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ describe("RtlScrollConverter", (): void => {
});

it("invertedGetRtlScrollConverter returns correct value", () => {
const scale = window.devicePixelRatio;
const testElement: HTMLDivElement = getDummyDiv();
document.body.appendChild(testElement);
testElement.scrollLeft = 1;

expect(RtlScrollConverter["invertedGetRtlScrollConverter"](testElement)).to.equal(
-1
-1 / scale
);
});

Expand Down

0 comments on commit a7a3c89

Please sign in to comment.