Skip to content

Commit bb5c459

Browse files
authored
PR_26171_035 remove idea board notes heading
Remove the visible Notes heading from expanded Idea Board notes rows. Validation: - node --check toolbox/idea-board/index.js - node --check tests/playwright/tools/IdeaBoardTableNotes.spec.mjs - node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs - npx playwright test tests/playwright/tools/IdeaBoardTableNotes.spec.mjs --project=playwright --workers=1 --reporter=line - npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --project=playwright --workers=1 --reporter=line -g "Idea Board launches" - npm run test:workspace-v2
1 parent 041d15b commit bb5c459

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

tests/playwright/tools/IdeaBoardTableNotes.spec.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ test("Idea Board uses DB-shaped accordion table ideas and notes", async ({ page
104104
await page.locator("[data-idea-board-idea-cell='top-thoughts']").click();
105105
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toBeVisible();
106106
await expectIdeaChevron(page, "top-thoughts", "gfs-chevron-up.svg");
107-
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header='top-thoughts']")).toHaveText("Notes");
107+
await expect(page.locator("[data-idea-board-idea-row='top-thoughts'] + [data-idea-board-expanded-row='top-thoughts']")).toHaveCount(1);
108+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header]")).toHaveCount(0);
109+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] :is(h1,h2,h3,h4,h5,h6)").filter({ hasText: /^Notes$/ })).toHaveCount(0);
110+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] > td > .content-stack")).toHaveCount(0);
108111
await expect(page.locator("[data-idea-board-notes-table='top-thoughts'] th[scope='col']")).toHaveText(["Note", "Actions"]);
109112
await expect(page.locator("[data-idea-board-notes-table] th[scope='col']", { hasText: "Type" })).toHaveCount(0);
110113
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
139142
await page.locator("[data-idea-board-idea-cell='sky-orchard']").click();
140143
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toHaveCount(0);
141144
await expect(page.locator("[data-idea-board-expanded-row='sky-orchard']")).toBeVisible();
145+
await expect(page.locator("[data-idea-board-idea-row='sky-orchard'] + [data-idea-board-expanded-row='sky-orchard']")).toHaveCount(1);
142146
await expectIdeaChevron(page, "sky-orchard", "gfs-chevron-up.svg");
143147
await page.locator("[data-idea-board-notes-count='sky-orchard']").click();
144148
await expect(page.locator("[data-idea-board-expanded-row='sky-orchard']")).toBeVisible();

tests/playwright/tools/ToolboxRoutePages.spec.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ test("Idea Board launches from Toolbox with accordion table notes model", async
259259
await page.locator("[data-idea-board-idea-cell='top-thoughts']").click();
260260
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts']")).toBeVisible();
261261
await expectIdeaChevron(page, "top-thoughts", "gfs-chevron-up.svg");
262-
await expect(page.locator("[data-idea-board-notes-header='top-thoughts']")).toHaveText("Notes");
262+
await expect(page.locator("[data-idea-board-idea-row='top-thoughts'] + [data-idea-board-expanded-row='top-thoughts']")).toHaveCount(1);
263+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] [data-idea-board-notes-header]")).toHaveCount(0);
264+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] :is(h1,h2,h3,h4,h5,h6)").filter({ hasText: /^Notes$/ })).toHaveCount(0);
265+
await expect(page.locator("[data-idea-board-expanded-row='top-thoughts'] > td > .content-stack")).toHaveCount(0);
263266
await expect(page.locator("[data-idea-board-notes-table='top-thoughts'] th[scope='col']")).toHaveText(["Note", "Actions"]);
264267
await expect(page.getByText("Notes for Sky Orchard")).toHaveCount(0);
265268
await expect(page.getByText("Selected idea context")).toHaveCount(0);

toolbox/idea-board/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,6 @@ function renderExpandedNotesRow(tbody, record) {
269269
const content = document.createElement("td");
270270
content.colSpan = 6;
271271

272-
const wrapper = document.createElement("div");
273-
wrapper.className = "content-stack";
274-
const heading = document.createElement("h3");
275-
heading.textContent = "Notes";
276-
heading.dataset.ideaBoardNotesHeader = record.ideaId;
277-
wrapper.append(heading);
278-
279272
const tableWrapper = document.createElement("div");
280273
tableWrapper.className = "table-wrapper";
281274
const notesTable = document.createElement("table");
@@ -288,7 +281,7 @@ function renderExpandedNotesRow(tbody, record) {
288281
notesBody.dataset.ideaBoardNotesBody = record.ideaId;
289282
notesTable.append(notesBody);
290283
tableWrapper.append(notesTable);
291-
wrapper.append(tableWrapper);
284+
content.append(tableWrapper);
292285

293286
for (const note of notesForIdea(record.ideaId)) {
294287
if (state.editingNoteId === note.noteId) {
@@ -304,9 +297,8 @@ function renderExpandedNotesRow(tbody, record) {
304297
const addNote = actionButton("Add Note", "add", "ideaBoardNoteAction", "primary");
305298
addNote.dataset.ideaBoardAddNote = record.ideaId;
306299
controls.append(addNote);
307-
wrapper.append(controls);
300+
content.append(controls);
308301

309-
content.append(wrapper);
310302
row.append(content);
311303
tbody.append(row);
312304
}

0 commit comments

Comments
 (0)