Skip to content

Commit

Permalink
chore: Improve test to validate actual translation
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Dec 8, 2024
1 parent b2fdc04 commit 0ae6984
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,9 @@ public async Task When_Element_Has_Translation_And_Visual_Has_Offset()

[TestMethod]
[RunsOnUIThread]
#if !__SKIA__
[Ignore("Translation X and Y axis is currently supported on Skia only")]
#endif
public async Task When_Translation_On_Load()
{
var sut = new Rectangle()
Expand All @@ -1582,10 +1585,11 @@ public async Task When_Translation_On_Load()
canvas.Children.Add(sut);
TestServices.WindowHelper.WindowContent = canvas;
await TestServices.WindowHelper.WaitForLoaded(sut);
sut.Translation += new Vector3(200, 0, 128);
sut.Translation += new Vector3(100, 100, 128);
await TestServices.WindowHelper.WaitForIdle();
var bitmap = await UITestHelper.ScreenShot(canvas);
ImageAssert.DoesNotHaveColorAt(bitmap, new Windows.Foundation.Point(50, 50), Microsoft.UI.Colors.Blue, tolerance: 25);
ImageAssert.DoesNotHaveColorAt(bitmap, new Windows.Foundation.Point(50, 50), Microsoft.UI.Colors.Blue);
ImageAssert.HasColorAt(bitmap, new Windows.Foundation.Point(150, 150), Microsoft.UI.Colors.Blue);
}

#if HAS_UNO
Expand Down

0 comments on commit 0ae6984

Please sign in to comment.