From 0cb3513532bc5b92a5b62a889a7dc5fe74346c65 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Mon, 16 Sep 2024 00:43:58 +0200 Subject: [PATCH] tests: use rectEquals --- src/tests/flows/maximization.ts | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/tests/flows/maximization.ts b/src/tests/flows/maximization.ts index 2ee23a4..41173d8 100644 --- a/src/tests/flows/maximization.ts +++ b/src/tests/flows/maximization.ts @@ -6,7 +6,7 @@ 1, "app1", "Application 1", - new MockQmlRect(0, 0, 300, 200), + new MockQmlRect(10, 20, 300, 200), ); workspaceMock.createWindow(kwinClient); @@ -15,32 +15,17 @@ }) kwinClient.fullScreen = true; - { - const frame = kwinClient.frameGeometry; - assert(frame.width === screenWidth && frame.height === screenHeight); - } + assert(rectEquals(kwinClient.frameGeometry, new MockQmlRect(0, 0, screenWidth, screenHeight))); kwinClient.fullScreen = false; - { - const frame = kwinClient.frameGeometry; - assert(frame.width === 300 && frame.height === 200); - } + assert(rectEquals(kwinClient.frameGeometry, new MockQmlRect(10, 20, 300, 200))); kwinClient.setMaximize(true, true); - { - const frame = kwinClient.frameGeometry; - assert(frame.width === screenWidth && frame.height === screenHeight); - } + assert(rectEquals(kwinClient.frameGeometry, new MockQmlRect(0, 0, screenWidth, screenHeight))); kwinClient.setMaximize(true, false); - { - const frame = kwinClient.frameGeometry; - assert(frame.width === 300 && frame.height === screenHeight); - } + assert(rectEquals(kwinClient.frameGeometry, new MockQmlRect(10, 0, 300, screenHeight))); kwinClient.setMaximize(false, false); - { - const frame = kwinClient.frameGeometry; - assert(frame.width === 300 && frame.height === 200); - } + assert(rectEquals(kwinClient.frameGeometry, new MockQmlRect(10, 20, 300, 200))); }