@@ -7,10 +7,12 @@ import {
77 DRAG_HANDLE_MENU_SELECTOR ,
88 DRAG_HANDLE_SELECTOR ,
99 H_TWO_BLOCK_SELECTOR ,
10+ TABLE_SELECTOR ,
1011 TEXT_COLOR_SELECTOR ,
1112} from "../../utils/const.js" ;
1213import { insertHeading , insertParagraph } from "../../utils/copypaste.js" ;
1314import { focusOnEditor } from "../../utils/editor.js" ;
15+ import { executeSlashCommand } from "../../utils/slashmenu.js" ;
1416
1517test . beforeEach ( async ( { page } ) => {
1618 await page . goto ( BASE_URL , { waitUntil : "networkidle" } ) ;
@@ -109,4 +111,26 @@ test.describe("Check Background & Text Color Functionality", () => {
109111
110112 expect ( await page . screenshot ( ) ) . toMatchSnapshot ( "blockBackgroundColor.png" ) ;
111113 } ) ;
114+ // Regression test: prosemirror-tables' TableView.update() preserves the
115+ // NodeView's DOM without re-applying node attrs, so prop changes (e.g.
116+ // textColor) wouldn't propagate to the blockContent wrapper. BlockNoteTableView
117+ // overrides update() to sync prop-derived data-* attributes.
118+ test ( "Should be able to set block text color on a table" , async ( {
119+ page,
120+ } ) => {
121+ await focusOnEditor ( page ) ;
122+ await executeSlashCommand ( page , "table" ) ;
123+ await page . keyboard . type ( "Table Cell" ) ;
124+
125+ await page . hover ( TABLE_SELECTOR ) ;
126+ await page . click ( DRAG_HANDLE_SELECTOR ) ;
127+ await page . waitForSelector ( DRAG_HANDLE_MENU_SELECTOR ) ;
128+ await page . hover ( "text=Colors" ) ;
129+
130+ const element = page . locator ( TEXT_COLOR_SELECTOR ( "red" ) ) ;
131+ const boundingBox = ( await element . boundingBox ( ) ) ! ;
132+ await page . mouse . click ( boundingBox . x + 10 , boundingBox . y + 10 ) ;
133+
134+ expect ( await page . screenshot ( ) ) . toMatchSnapshot ( "blockTextColorTable.png" ) ;
135+ } ) ;
112136} ) ;
0 commit comments