@@ -5,9 +5,9 @@ test.describe("interactive examples", () => {
5
5
page,
6
6
} ) => {
7
7
await page . goto ( "/learn" )
8
- await page . waitForSelector ( ".CodeMirror " , { timeout : 10000 } )
8
+ await page . waitForSelector ( ".cm-editor " , { timeout : 10000 } )
9
9
10
- const editors = page . locator ( ".miniGraphiQL " )
10
+ const editors = page . locator ( ".cm-editor " )
11
11
let heroEditor : Locator | null = null
12
12
13
13
for ( let i = 0 ; i < ( await editors . count ( ) ) ; i ++ ) {
@@ -23,12 +23,7 @@ test.describe("interactive examples", () => {
23
23
throw new Error ( "Could not find hero GraphQL editor" )
24
24
}
25
25
26
- const codeMirrorEditor = heroEditor . locator ( ".CodeMirror" ) . first ( )
27
- await expect ( codeMirrorEditor ) . toBeVisible ( )
28
-
29
- await codeMirrorEditor . click ( )
30
-
31
- const codeLines = codeMirrorEditor . locator ( ".CodeMirror-line" )
26
+ const codeLines = heroEditor . locator ( ".cm-line" )
32
27
33
28
// Find the line containing "name" and click after it
34
29
for ( let i = 0 ; i < ( await codeLines . count ( ) ) ; i ++ ) {
@@ -47,20 +42,24 @@ test.describe("interactive examples", () => {
47
42
await page . keyboard . type ( "ap" )
48
43
await page . keyboard . press ( "Control+Space" )
49
44
50
- const autoCompleteMenu = page . locator ( ".CodeMirror-hints " )
45
+ const autoCompleteMenu = page . locator ( ".cm-tooltip-autocomplete " )
51
46
await expect ( autoCompleteMenu ) . toBeVisible ( { timeout : 5000 } )
52
47
53
48
const appearsInSuggestion = page
54
- . locator ( ".CodeMirror-hints li " )
49
+ . locator ( ".cm-completionLabel " )
55
50
. filter ( { hasText : "appearsIn" } )
56
51
52
+ expect ( page . locator ( ".cm-completionDetail" ) . first ( ) ) . toHaveText (
53
+ "[Episode]!" ,
54
+ )
55
+
57
56
if ( await appearsInSuggestion . isVisible ( ) ) {
58
57
await appearsInSuggestion . click ( )
59
58
} else {
60
59
await page . keyboard . press ( "Enter" )
61
60
}
62
61
63
- const resultViewer = heroEditor . locator ( ".result-window" )
62
+ const resultViewer = page . locator ( ".result-window" ) . first ( )
64
63
await expect ( resultViewer ) . toBeVisible ( )
65
64
66
65
await expect
@@ -91,7 +90,7 @@ test.describe("interactive examples", () => {
91
90
await page . waitForLoadState ( "networkidle" )
92
91
93
92
// Find the mutation example that has GraphiQL enabled
94
- const editors = page . locator ( ".miniGraphiQL " )
93
+ const editors = page . locator ( ".cm-editor " )
95
94
let mutationEditor : Locator | null = null
96
95
97
96
for ( let i = 0 ; i < ( await editors . count ( ) ) ; i ++ ) {
0 commit comments