@@ -123,7 +123,7 @@ afterEach(() => {
123123} ) ;
124124
125125describe ( "AgentMarkdownTable fullscreen" , ( ) => {
126- it ( "renders the Table primitives font-mono text-xs, preserving a link inside a cell " , ( ) => {
126+ it ( "opens a fullscreen dialog and preserves links inside cells " , ( ) => {
127127 render ( ) ;
128128
129129 const maximizeButton = container ! . querySelector < HTMLButtonElement > (
@@ -140,114 +140,7 @@ describe("AgentMarkdownTable fullscreen", () => {
140140 ) ;
141141 expect ( dialog ) . toBeTruthy ( ) ;
142142
143- // TableHeader is the only thing that renders a sticky `thead` — proves the primitive, not a
144- // plain `<thead>`, rendered here.
145- const thead = dialog ! . querySelector ( "thead" ) ;
146- expect ( thead ?. className ) . toContain ( "sticky" ) ;
147-
148143 const link = dialog ! . querySelector ( "a[href='https://example.com']" ) ;
149144 expect ( link ?. textContent ) . toBe ( "docs" ) ;
150-
151- const th = dialog ! . querySelector ( "th" ) ;
152- const td = dialog ! . querySelector ( "td" ) ;
153- expect ( th ?. className ) . toContain ( "font-mono" ) ;
154- expect ( th ?. className ) . toContain ( "text-xs" ) ;
155- expect ( td ?. className ) . toContain ( "font-mono" ) ;
156- expect ( td ?. className ) . toContain ( "text-xs" ) ;
157-
158- const triggers = document . querySelectorAll ( '[aria-label="More actions"]' ) ;
159- const dialogTrigger = [ ...triggers ] . find ( ( el ) => ! container ! . contains ( el ) ) ;
160- expect ( dialogTrigger ) . toBeTruthy ( ) ;
161- } ) ;
162-
163- it ( "gives every row the same full-width bottom separator, header and body alike" , ( ) => {
164- render ( ) ;
165-
166- act ( ( ) => {
167- container ! . querySelector < HTMLButtonElement > ( '[aria-label="Maximize chart"]' ) ! . click ( ) ;
168- } ) ;
169- const dialog = [ ...document . querySelectorAll ( "[role='dialog']" ) ] . find (
170- ( el ) => ! container ! . contains ( el )
171- ) ! ;
172-
173- const rows = [ ...dialog . querySelectorAll ( "tr" ) ] ;
174- expect ( rows . length ) . toBeGreaterThanOrEqual ( 3 ) ;
175- const rowClasses = rows . map ( ( row ) => row . className ) ;
176-
177- // Same class list for every row (header included) — no per-row inset that would stagger
178- // the separator line — and it spans the full row width, not inset from the first cell.
179- expect ( new Set ( rowClasses ) . size ) . toBe ( 1 ) ;
180- expect ( rowClasses [ 0 ] ) . toContain ( "after:left-0" ) ;
181- expect ( rowClasses [ 0 ] ) . not . toContain ( "after:left-3" ) ;
182- } ) ;
183-
184- it ( "keeps a GFM right-aligned column's text-align in fullscreen" , ( ) => {
185- container = document . createElement ( "div" ) ;
186- document . body . appendChild ( container ) ;
187- root = createRoot ( container ) ;
188- act ( ( ) => {
189- root ! . render (
190- createElement (
191- OperatingSystemContextProvider ,
192- { platform : "mac" } ,
193- createElement (
194- ShortcutsProvider ,
195- null ,
196- createElement (
197- AgentMarkdownTable ,
198- { node : tableNode ( ) } ,
199- createElement (
200- AgentMarkdownTableHead ,
201- { key : "thead" } ,
202- createElement (
203- AgentMarkdownTableRow ,
204- { key : "tr" } ,
205- createElement ( AgentMarkdownTableHeaderCell , { key : "a" } , "a" ) ,
206- createElement (
207- AgentMarkdownTableHeaderCell ,
208- { key : "b" , style : { textAlign : "right" } } ,
209- "b"
210- )
211- )
212- ) ,
213- createElement (
214- AgentMarkdownTableBody ,
215- { key : "tbody" } ,
216- createElement (
217- AgentMarkdownTableRow ,
218- { key : "tr" } ,
219- createElement ( AgentMarkdownTableCell , { key : "1" } , "1" ) ,
220- createElement (
221- AgentMarkdownTableCell ,
222- { key : "2" , style : { textAlign : "right" } } ,
223- "2"
224- )
225- )
226- )
227- )
228- )
229- )
230- ) ;
231- } ) ;
232-
233- act ( ( ) => {
234- container ! . querySelector < HTMLButtonElement > ( '[aria-label="Maximize chart"]' ) ! . click ( ) ;
235- } ) ;
236- const dialog = [ ...document . querySelectorAll ( "[role='dialog']" ) ] . find (
237- ( el ) => ! container ! . contains ( el )
238- ) ! ;
239-
240- // `TableCell` (td) forwards `style` straight onto the DOM node, so alignment shows up as
241- // inline style. `TableHeaderCell` (th) has no `style` prop — it takes an `alignment` enum
242- // that renders as a text-right/text-center/text-left class instead, so it's asserted there.
243- const rightTd = [ ...dialog . querySelectorAll ( "td" ) ] . find ( ( cell ) => cell . textContent === "2" ) ;
244- const leftTd = [ ...dialog . querySelectorAll ( "td" ) ] . find ( ( cell ) => cell . textContent === "1" ) ;
245- expect ( ( rightTd as HTMLElement ) . style . textAlign ) . toBe ( "right" ) ;
246- expect ( ( leftTd as HTMLElement ) . style . textAlign ) . not . toBe ( "right" ) ;
247-
248- const rightTh = [ ...dialog . querySelectorAll ( "th" ) ] . find ( ( cell ) => cell . textContent === "b" ) ;
249- const leftTh = [ ...dialog . querySelectorAll ( "th" ) ] . find ( ( cell ) => cell . textContent === "a" ) ;
250- expect ( rightTh ?. className ) . toContain ( "text-right" ) ;
251- expect ( leftTh ?. className ) . not . toContain ( "text-right" ) ;
252145 } ) ;
253146} ) ;
0 commit comments