diff --git a/tests/playwright/tools/IdeaBoardTableNotes.spec.mjs b/tests/playwright/tools/IdeaBoardTableNotes.spec.mjs index 2f1775a74..162693064 100644 --- a/tests/playwright/tools/IdeaBoardTableNotes.spec.mjs +++ b/tests/playwright/tools/IdeaBoardTableNotes.spec.mjs @@ -104,7 +104,10 @@ test("Idea Board uses DB-shaped accordion table ideas and notes", async ({ page await page.locator("[data-idea-board-idea-cell='top-thoughts']").click(); await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toBeVisible(); await expectIdeaChevron(page, "top-thoughts", "gfs-chevron-up.svg"); - await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header='top-thoughts']")).toHaveText("Notes"); + await expect(page.locator("[data-idea-board-idea-row='top-thoughts'] + [data-idea-board-expanded-row='top-thoughts']")).toHaveCount(1); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header]")).toHaveCount(0); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] :is(h1,h2,h3,h4,h5,h6)").filter({ hasText: /^Notes$/ })).toHaveCount(0); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] > td > .content-stack")).toHaveCount(0); await expect(page.locator("[data-idea-board-notes-table='top-thoughts'] th[scope='col']")).toHaveText(["Note", "Actions"]); await expect(page.locator("[data-idea-board-notes-table] th[scope='col']", { hasText: "Type" })).toHaveCount(0); await expect(page.locator("[data-idea-board-notes-table] th[scope='col']", { hasText: "Created By" })).toHaveCount(0); @@ -139,6 +142,7 @@ test("Idea Board uses DB-shaped accordion table ideas and notes", async ({ page await page.locator("[data-idea-board-idea-cell='sky-orchard']").click(); await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toHaveCount(0); await expect(page.locator("[data-idea-board-expanded-row='sky-orchard']")).toBeVisible(); + await expect(page.locator("[data-idea-board-idea-row='sky-orchard'] + [data-idea-board-expanded-row='sky-orchard']")).toHaveCount(1); await expectIdeaChevron(page, "sky-orchard", "gfs-chevron-up.svg"); await page.locator("[data-idea-board-notes-count='sky-orchard']").click(); await expect(page.locator("[data-idea-board-expanded-row='sky-orchard']")).toBeVisible(); diff --git a/tests/playwright/tools/ToolboxRoutePages.spec.mjs b/tests/playwright/tools/ToolboxRoutePages.spec.mjs index 60fa5e24b..f7f300df2 100644 --- a/tests/playwright/tools/ToolboxRoutePages.spec.mjs +++ b/tests/playwright/tools/ToolboxRoutePages.spec.mjs @@ -259,7 +259,10 @@ test("Idea Board launches from Toolbox with accordion table notes model", async await page.locator("[data-idea-board-idea-cell='top-thoughts']").click(); await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toBeVisible(); await expectIdeaChevron(page, "top-thoughts", "gfs-chevron-up.svg"); - await expect(page.locator("[data-idea-board-notes-header='top-thoughts']")).toHaveText("Notes"); + await expect(page.locator("[data-idea-board-idea-row='top-thoughts'] + [data-idea-board-expanded-row='top-thoughts']")).toHaveCount(1); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header]")).toHaveCount(0); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] :is(h1,h2,h3,h4,h5,h6)").filter({ hasText: /^Notes$/ })).toHaveCount(0); + await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] > td > .content-stack")).toHaveCount(0); await expect(page.locator("[data-idea-board-notes-table='top-thoughts'] th[scope='col']")).toHaveText(["Note", "Actions"]); await expect(page.getByText("Notes for Sky Orchard")).toHaveCount(0); await expect(page.getByText("Selected idea context")).toHaveCount(0); diff --git a/toolbox/idea-board/index.js b/toolbox/idea-board/index.js index 75d52d64d..ee7f0d932 100644 --- a/toolbox/idea-board/index.js +++ b/toolbox/idea-board/index.js @@ -269,13 +269,6 @@ function renderExpandedNotesRow(tbody, record) { const content = document.createElement("td"); content.colSpan = 6; - const wrapper = document.createElement("div"); - wrapper.className = "content-stack"; - const heading = document.createElement("h3"); - heading.textContent = "Notes"; - heading.dataset.ideaBoardNotesHeader = record.ideaId; - wrapper.append(heading); - const tableWrapper = document.createElement("div"); tableWrapper.className = "table-wrapper"; const notesTable = document.createElement("table"); @@ -288,7 +281,7 @@ function renderExpandedNotesRow(tbody, record) { notesBody.dataset.ideaBoardNotesBody = record.ideaId; notesTable.append(notesBody); tableWrapper.append(notesTable); - wrapper.append(tableWrapper); + content.append(tableWrapper); for (const note of notesForIdea(record.ideaId)) { if (state.editingNoteId === note.noteId) { @@ -304,9 +297,8 @@ function renderExpandedNotesRow(tbody, record) { const addNote = actionButton("Add Note", "add", "ideaBoardNoteAction", "primary"); addNote.dataset.ideaBoardAddNote = record.ideaId; controls.append(addNote); - wrapper.append(controls); + content.append(controls); - content.append(wrapper); row.append(content); tbody.append(row); }