You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(block-editing): repair edit-cell-sizing no-reflow e2e for measure-and-set
The active editor REPLACES the block with a synthetic measure-and-set
wrapper (no data-block-pool-id, different tag), so the old tests re-queried
<tag>[data-block-pool-id] after activation and either re-resolved to a
different block or detached and timed out — they never reached the actual
no-reflow assertion.
- Add a namespaced id #q2-active-edit-region to the wrapper div so the
active editor has a stable selector (kept alongside activeEditRegionRef;
namespaced to avoid colliding with Pandoc heading auto-ids in rendered
content).
- Rewrite the three adjacency tests to assert BOTH contract parts:
(1) active-region height == block height (sizing), measured on the new
wrapper; (2) following-sibling document-top unchanged (no reflow),
measured scroll-invariantly. Verified green against the real q2 binary.
// Wrapper (p) must not change height on activation.
95
-
expect(
96
-
Math.abs(paraBoxAfter!.height-paraBox!.height),
97
-
`paragraph height changed from ${paraBox!.height}px to ${paraBoxAfter!.height}px on activation`,
98
-
).toBeLessThanOrEqual(1);
99
-
100
-
// Heading must not shift (P1 no-reflow — the key assertion, fails without wrapper fix).
101
-
expect(
102
-
Math.abs(headingTopAfter-headingTopBefore),
103
-
`heading top shifted by ${Math.abs(headingTopAfter-headingTopBefore).toFixed(1)}px on paragraph activation (was ${headingTopBefore.toFixed(1)}px, now ${headingTopAfter.toFixed(1)}px); margin-bottom was likely lost`,
104
-
).toBeLessThanOrEqual(1);
137
+
awaitassertNoReflowOnActivation(
138
+
page,
139
+
iframe.locator('p[data-block-pool-id]').first(),
140
+
iframe.locator('h2').first(),
141
+
'paragraph→heading',
142
+
);
105
143
});
106
144
107
-
test('heading: wrapper height and following list top are unchanged on activation',async({ page })=>{
145
+
test('heading: active region height and following list top unchanged on activation',async({ page })=>{
`heading height changed from ${headingBox!.height}px to ${headingBoxAfter!.height}px on activation`,
134
-
).toBeLessThanOrEqual(1);
135
-
136
-
// List must not shift (P1 no-reflow — the key assertion, fails without wrapper fix).
137
-
expect(
138
-
Math.abs(listTopAfter-listTopBefore),
139
-
`list top shifted by ${Math.abs(listTopAfter-listTopBefore).toFixed(1)}px on heading activation (was ${listTopBefore.toFixed(1)}px, now ${listTopAfter.toFixed(1)}px); margin-bottom was likely lost`,
140
-
).toBeLessThanOrEqual(1);
149
+
awaitassertNoReflowOnActivation(
150
+
page,
151
+
iframe.locator('h2[data-block-pool-id]').first(),
152
+
iframe.locator('ul').first(),
153
+
'heading→list',
154
+
);
141
155
});
142
156
143
-
test('paragraph above list: wrapper height and list top unchanged on activation',async({ page })=>{
157
+
test('paragraph above list: active region height and list top unchanged on activation',async({ page })=>{
144
158
awaitpage.goto(server.url);
145
159
awaitwaitForEditableBlocks(page);
146
-
147
160
constiframe=page.frameLocator('iframe');
148
-
// Second paragraph — sits directly above a list with no heading between them.
// Wrapper (p) must not change height on activation.
169
-
expect(
170
-
Math.abs(paraBoxAfter!.height-paraBox!.height),
171
-
`paragraph height changed from ${paraBox!.height}px to ${paraBoxAfter!.height}px on activation`,
172
-
).toBeLessThanOrEqual(1);
173
-
174
-
// List must not shift (para→list adjacency, no heading between them).
175
-
expect(
176
-
Math.abs(listTopAfter-listTopBefore),
177
-
`list top shifted by ${Math.abs(listTopAfter-listTopBefore).toFixed(1)}px on paragraph activation (was ${listTopBefore.toFixed(1)}px, now ${listTopAfter.toFixed(1)}px); margin-bottom was likely lost`,
0 commit comments