Skip to content

Commit f7b4095

Browse files
committed
Another attempt to get around flaky CI test
1 parent f33bb3a commit f7b4095

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/webtest-draw-decoration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,15 +933,17 @@ describe("EditorView decoration", () => {
933933
let cm = wrapEditor("a\nb\nc\nd", [
934934
BlockWrapper.create({tagName: "div", attributes: {style: "padding: 3px"}}).range(2, 5)
935935
])
936-
let eltTop = cm.elementAtHeight(cm.coordsAtPos(1)!.bottom + 2 - cm.documentTop)
936+
cm.measure()
937+
let wrapRect = cm.contentDOM.children[1].getBoundingClientRect()
938+
let eltTop = cm.elementAtHeight(wrapRect.top + 1 - cm.documentTop)
937939
ist(eltTop.type, BlockType.WidgetRange)
938940
ist(eltTop.from, 2)
939941
ist(eltTop.height, 3, near)
940942
let elt2 = cm.elementAtHeight(cm.coordsAtPos(2)!.top + 1 - cm.documentTop)
941943
ist(elt2.type, BlockType.Text)
942944
ist(elt2.from, 2)
943945
ist(elt2.top, eltTop.bottom, near)
944-
let eltBot = cm.elementAtHeight(cm.coordsAtPos(5)!.bottom + 2 - cm.documentTop)
946+
let eltBot = cm.elementAtHeight(wrapRect.bottom - 1 - cm.documentTop)
945947
ist(eltBot.type, BlockType.WidgetRange)
946948
let blocks = cm.viewportLineBlocks
947949
ist(blocks.length, 4)

0 commit comments

Comments
 (0)