Skip to content

Commit 56c4308

Browse files
committed
Fix test to match new logic
1 parent a9d393e commit 56c4308

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

test/e2e/graphql-interactive.spec.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,18 @@ test.describe("interactive examples", () => {
153153

154154
await editor.click()
155155

156-
await typeInQuery(page, editor, "tagline", "des")
156+
await typeInQuery(page, editor, "tagline", "contr")
157157

158158
await page.keyboard.press("Control+Space")
159+
let autoCompleteMenu = page.locator(".cm-tooltip-autocomplete")
160+
await expect(autoCompleteMenu).toBeVisible({ timeout: 5000 })
161+
await page.locator(".cm-completionLabel").click()
159162

160-
const autoCompleteMenu = page.locator(".cm-tooltip-autocomplete")
163+
await page.keyboard.type("(first: 2) {\n")
164+
await page.keyboard.type("cont")
165+
166+
await page.keyboard.press("Control+Space")
167+
autoCompleteMenu = page.locator(".cm-tooltip-autocomplete")
161168
await expect(autoCompleteMenu).toBeVisible({ timeout: 5000 })
162169
await page.locator(".cm-completionLabel").click()
163170

@@ -170,8 +177,14 @@ test.describe("interactive examples", () => {
170177
const jsonMatch = resultContent?.match(/\{[\s\S]*\}/)
171178
if (jsonMatch) {
172179
try {
173-
const result = JSON.parse(jsonMatch[0])
174-
return result.project && result.project.description ? true : false
180+
const data = JSON.parse(jsonMatch[0])
181+
if (data?.project?.contributors?.length === 2) {
182+
const contributors = data.project.contributors
183+
return (
184+
contributors[0].contributions >= contributors[1].contributions
185+
)
186+
}
187+
return false
175188
} catch {
176189
return false
177190
}

0 commit comments

Comments
 (0)