1
1
const Application = require ( "spectron" ) . Application ;
2
2
const electronPath = require ( "electron" ) ;
3
- const { activeWindow , windows } = require ( "@nut-tree/nut-js" ) ;
3
+ const { getActiveWindow , getWindows } = require ( "@nut-tree/nut-js" ) ;
4
4
const { POS_X , POS_Y , WIDTH , HEIGTH , TITLE } = require ( "./constants" ) ;
5
5
const { join } = require ( "path" ) ;
6
6
@@ -24,7 +24,7 @@ beforeAll(async () => {
24
24
describe ( "getWindows" , ( ) => {
25
25
it ( "should list our started application window" , async ( ) => {
26
26
// GIVEN
27
- const openWindows = await windows ( ) ;
27
+ const openWindows = await getWindows ( ) ;
28
28
29
29
// WHEN
30
30
const windowNames = await Promise . all ( openWindows . map ( ( wnd ) => wnd . title ) ) ;
@@ -39,7 +39,7 @@ describe("getActiveWindow", () => {
39
39
// GIVEN
40
40
41
41
// WHEN
42
- const foregroundWindow = await activeWindow ( ) ;
42
+ const foregroundWindow = await getActiveWindow ( ) ;
43
43
const windowTitle = await foregroundWindow . title ;
44
44
45
45
// THEN
@@ -50,7 +50,7 @@ describe("getActiveWindow", () => {
50
50
// GIVEN
51
51
52
52
// WHEN
53
- const foregroundWindow = await activeWindow ( ) ;
53
+ const foregroundWindow = await getActiveWindow ( ) ;
54
54
const activeWindowRegion = await foregroundWindow . region ;
55
55
56
56
// THEN
@@ -67,7 +67,7 @@ describe("getActiveWindow", () => {
67
67
await app . browserWindow . setPosition ( xPosition , yPosition ) ;
68
68
69
69
// WHEN
70
- const foregroundWindow = await activeWindow ( ) ;
70
+ const foregroundWindow = await getActiveWindow ( ) ;
71
71
const activeWindowRegion = await foregroundWindow . region ;
72
72
73
73
// THEN
@@ -82,7 +82,7 @@ describe("getActiveWindow", () => {
82
82
await app . browserWindow . setSize ( newWidth , newHeight ) ;
83
83
84
84
// WHEN
85
- const foregroundWindow = await activeWindow ( ) ;
85
+ const foregroundWindow = await getActiveWindow ( ) ;
86
86
const activeWindowRegion = await foregroundWindow . region ;
87
87
88
88
// THEN
0 commit comments