Skip to content

Commit 90c8706

Browse files
committed
test(ui): scope settings-layout advanced-disclosure clicks to its own summary
Companion to #131541, which fixed the strict-mode violation in config-form-guidance: settings-layout carries the same under-scoped summary locator; scope it to :scope > summary before it can trip the same way once its clicks happen against expanded advanced content.
1 parent bfe3d68 commit 90c8706

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎ui/src/e2e/settings-layout.e2e.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ suite.define(() => {
202202
expect(Math.abs(spacing.belowTabs - spacing.aboveTabs)).toBeLessThanOrEqual(1);
203203

204204
const advanced = page.locator("details.config-advanced-disclosure");
205+
// Scope to the disclosure's own summary; expanded advanced content can
206+
// add nested collapsible-object summaries a bare locator would match.
207+
const advancedSummary = advanced.locator(":scope > summary");
205208
await expect.poll(() => advanced.count()).toBe(1);
206209
await expect.poll(() => advanced.getAttribute("open")).toBeNull();
207-
await expect
208-
.poll(() => advanced.locator("summary").textContent())
209-
.toContain("Advanced settings");
210+
await expect.poll(() => advancedSummary.textContent()).toContain("Advanced settings");
210211
if (proofEnabled) {
211212
await mkdir(proofDir, { recursive: true });
212213
await page.screenshot({
@@ -216,7 +217,7 @@ suite.define(() => {
216217
});
217218
}
218219

219-
await advanced.locator("summary").click();
220+
await advancedSummary.click();
220221
await expect.poll(() => advanced.getAttribute("open")).not.toBeNull();
221222
await expect.poll(() => page.getByText("Response prefix", { exact: true }).count()).toBe(1);
222223
if (proofEnabled) {

0 commit comments

Comments
 (0)