Skip to content

Commit 2530712

Browse files
Sync the verified file-reveal test into mobile dictation
2 parents 0249626 + 1733953 commit 2530712

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestCodeTab.browser.test.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ function pagedContainer() {
168168
return container;
169169
}
170170

171-
// Rows are virtualized, so a header far down is not rendered until the view scrolls to it.
172171
async function expectFileHeaderShown(
173172
screen: Awaited<ReturnType<typeof render>>,
174173
container: HTMLElement,
@@ -177,10 +176,10 @@ async function expectFileHeaderShown(
177176
const header = screen.getByText(path, { exact: true }).first();
178177
await expect.element(header).toBeInTheDocument();
179178
await vi.waitFor(() => {
180-
const top = header.element().getBoundingClientRect().top;
181-
const bounds = container.getBoundingClientRect();
179+
const bounds = container.querySelector(".diff-render-surface")!.getBoundingClientRect();
180+
const { top, bottom } = header.element().getBoundingClientRect();
182181
expect(top).toBeGreaterThanOrEqual(bounds.top);
183-
expect(top).toBeLessThan(bounds.top + bounds.height / 2);
182+
expect(bottom).toBeLessThanOrEqual(bounds.bottom);
184183
});
185184
}
186185

0 commit comments

Comments
 (0)