@@ -8,7 +8,7 @@ describe("Graph Navigation", () => {
8
8
it ( "Should pan right when the right arrow key is pressed" , async ( ) => {
9
9
const user = userEvent . setup ( )
10
10
await TestGraph . build ( )
11
- const svg = document . querySelector ( "svg " )
11
+ const svg = document . querySelector ( "#main-graph " )
12
12
const initialX = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 0 ] )
13
13
await user . keyboard ( "{ArrowRight}" )
14
14
const newX = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 0 ] )
@@ -19,7 +19,7 @@ describe("Graph Navigation", () => {
19
19
it ( "Should pan left when the left arrow key is pressed" , async ( ) => {
20
20
const user = userEvent . setup ( )
21
21
await TestGraph . build ( )
22
- const svg = document . querySelector ( "svg " )
22
+ const svg = document . querySelector ( "#main-graph " )
23
23
const initialX = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 0 ] )
24
24
await user . keyboard ( "{ArrowLeft}" )
25
25
const newX = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 0 ] )
@@ -30,7 +30,7 @@ describe("Graph Navigation", () => {
30
30
it ( "Should pan down when the down arrow key is pressed" , async ( ) => {
31
31
const user = userEvent . setup ( )
32
32
await TestGraph . build ( )
33
- const svg = document . querySelector ( "svg " )
33
+ const svg = document . querySelector ( "#main-graph " )
34
34
const initialY = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 1 ] )
35
35
await user . keyboard ( "{ArrowDown}" )
36
36
const newY = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 1 ] )
@@ -41,7 +41,7 @@ describe("Graph Navigation", () => {
41
41
it ( "Should pan up when the up arrow key is pressed" , async ( ) => {
42
42
const user = userEvent . setup ( )
43
43
await TestGraph . build ( )
44
- const svg = document . querySelector ( "svg " )
44
+ const svg = document . querySelector ( "#main-graph " )
45
45
const initialY = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 1 ] )
46
46
await user . keyboard ( "{ArrowUp}" )
47
47
const newY = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 1 ] )
@@ -52,7 +52,7 @@ describe("Graph Navigation", () => {
52
52
it ( "Should zoom in when the user presses the + key" , async ( ) => {
53
53
const user = userEvent . setup ( )
54
54
await TestGraph . build ( )
55
- const svg = document . querySelector ( "svg " )
55
+ const svg = document . querySelector ( "#main-graph " )
56
56
const initialDims = svg
57
57
. getAttribute ( "viewBox" )
58
58
. split ( " " )
@@ -73,7 +73,7 @@ describe("Graph Navigation", () => {
73
73
it ( "Should zoom out when the user presses the - key" , async ( ) => {
74
74
const user = userEvent . setup ( )
75
75
await TestGraph . build ( )
76
- const svg = document . querySelector ( "svg " )
76
+ const svg = document . querySelector ( "#main-graph " )
77
77
const initialDims = svg
78
78
. getAttribute ( "viewBox" )
79
79
. split ( " " )
@@ -94,7 +94,7 @@ describe("Graph Navigation", () => {
94
94
it ( "Should pan when the user clicks and drags" , async ( ) => {
95
95
const user = userEvent . setup ( )
96
96
await TestGraph . build ( )
97
- const svg = document . querySelector ( "svg " )
97
+ const svg = document . querySelector ( "#main-graph " )
98
98
const initialX = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 0 ] )
99
99
const initialY = parseInt ( svg . getAttribute ( "viewBox" ) . split ( " " ) [ 1 ] )
100
100
@@ -115,7 +115,7 @@ describe("Graph Navigation", () => {
115
115
116
116
it ( "Should zoom in when the mouse wheel is scrolled down" , async ( ) => {
117
117
const graph = await TestGraph . build ( )
118
- const svg = document . querySelector ( "svg " )
118
+ const svg = document . querySelector ( "#main-graph " )
119
119
const initialDims = svg
120
120
. getAttribute ( "viewBox" )
121
121
. split ( " " )
@@ -135,7 +135,7 @@ describe("Graph Navigation", () => {
135
135
136
136
it ( "Should zoom out when the mouse wheel is scrolled up" , async ( ) => {
137
137
const graph = await TestGraph . build ( )
138
- const svg = document . querySelector ( "svg " )
138
+ const svg = document . querySelector ( "#main-graph " )
139
139
const initialDims = svg
140
140
. getAttribute ( "viewBox" )
141
141
. split ( " " )
0 commit comments