Skip to content

Commit f359d29

Browse files
committed
chore: fix test
1 parent cc514dd commit f359d29

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/app/e2e/session/session-review.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ async function expand(page: Parameters<typeof test>[0]["page"]) {
8585
async function waitMark(page: Parameters<typeof test>[0]["page"], file: string, mark: string) {
8686
await page.waitForFunction(
8787
({ file, mark }) => {
88-
const head = Array.from(document.querySelectorAll("h3")).find(
88+
const view = document.querySelector('[data-slot="session-review-scroll"] .scroll-view__viewport')
89+
if (!(view instanceof HTMLElement)) return false
90+
91+
const head = Array.from(view.querySelectorAll("h3")).find(
8992
(node) => node instanceof HTMLElement && node.textContent?.includes(file),
9093
)
9194
if (!(head instanceof HTMLElement)) return false
@@ -106,7 +109,7 @@ async function spot(page: Parameters<typeof test>[0]["page"], file: string) {
106109
const view = document.querySelector('[data-slot="session-review-scroll"] .scroll-view__viewport')
107110
if (!(view instanceof HTMLElement)) return null
108111

109-
const row = Array.from(document.querySelectorAll("h3")).find(
112+
const row = Array.from(view.querySelectorAll("h3")).find(
110113
(node) => node instanceof HTMLElement && node.textContent?.includes(file),
111114
)
112115
if (!(row instanceof HTMLElement)) return null

0 commit comments

Comments
 (0)