11const Application = require ( "spectron" ) . Application ;
22const electronPath = require ( "electron" ) ;
3- const { activeWindow , windows } = require ( "@nut-tree/nut-js" ) ;
3+ const { getActiveWindow , getWindows } = require ( "@nut-tree/nut-js" ) ;
44const { POS_X , POS_Y , WIDTH , HEIGTH , TITLE } = require ( "./constants" ) ;
55const { join } = require ( "path" ) ;
66
@@ -24,7 +24,7 @@ beforeAll(async () => {
2424describe ( "getWindows" , ( ) => {
2525 it ( "should list our started application window" , async ( ) => {
2626 // GIVEN
27- const openWindows = await windows ( ) ;
27+ const openWindows = await getWindows ( ) ;
2828
2929 // WHEN
3030 const windowNames = await Promise . all ( openWindows . map ( ( wnd ) => wnd . title ) ) ;
@@ -39,7 +39,7 @@ describe("getActiveWindow", () => {
3939 // GIVEN
4040
4141 // WHEN
42- const foregroundWindow = await activeWindow ( ) ;
42+ const foregroundWindow = await getActiveWindow ( ) ;
4343 const windowTitle = await foregroundWindow . title ;
4444
4545 // THEN
@@ -50,7 +50,7 @@ describe("getActiveWindow", () => {
5050 // GIVEN
5151
5252 // WHEN
53- const foregroundWindow = await activeWindow ( ) ;
53+ const foregroundWindow = await getActiveWindow ( ) ;
5454 const activeWindowRegion = await foregroundWindow . region ;
5555
5656 // THEN
@@ -67,7 +67,7 @@ describe("getActiveWindow", () => {
6767 await app . browserWindow . setPosition ( xPosition , yPosition ) ;
6868
6969 // WHEN
70- const foregroundWindow = await activeWindow ( ) ;
70+ const foregroundWindow = await getActiveWindow ( ) ;
7171 const activeWindowRegion = await foregroundWindow . region ;
7272
7373 // THEN
@@ -82,7 +82,7 @@ describe("getActiveWindow", () => {
8282 await app . browserWindow . setSize ( newWidth , newHeight ) ;
8383
8484 // WHEN
85- const foregroundWindow = await activeWindow ( ) ;
85+ const foregroundWindow = await getActiveWindow ( ) ;
8686 const activeWindowRegion = await foregroundWindow . region ;
8787
8888 // THEN
0 commit comments