@@ -29,6 +29,7 @@ vi.mock('@/lib/table/column-types', () => ({
2929} ) )
3030
3131vi . mock ( '@sim/emcn/icons' , ( ) => ( {
32+ ArrowRight : ( ) => null ,
3233 Loader : ( ) => null ,
3334} ) )
3435
@@ -125,11 +126,18 @@ describe('ReferenceRowPreview', () => {
125126 expect ( container . textContent ) . toContain ( 'Acme' )
126127 expect ( container . textContent ) . toContain ( 'Enterprise' )
127128 expect ( container . textContent ) . not . toContain ( 'Open in sub view' )
128- const goToTableLink = Array . from ( container . querySelectorAll ( 'a' ) ) . find (
129- ( link ) => link . textContent === 'Go to table'
130- )
129+ const goToTableLink = container . querySelector ( 'a[aria-label="Go to table"]' )
131130 expect ( goToTableLink ?. getAttribute ( 'href' ) ) . toBe ( '/workspace/workspace-1/tables/table-accounts' )
131+ expect ( goToTableLink ?. getAttribute ( 'title' ) ) . toBe ( 'Go to table' )
132+ expect ( goToTableLink ?. className ) . toContain ( 'size-[20px]' )
133+ expect ( goToTableLink ?. className ) . toContain ( 'hover-hover:bg-[var(--surface-active)]' )
132134 expect ( goToTableLink ?. parentElement ?. className ) . toContain ( 'h-9' )
135+ expect ( goToTableLink ?. parentElement ?. className ) . toContain ( 'gap-1.5' )
136+ expect ( goToTableLink ?. previousElementSibling ?. textContent ) . toBe ( 'Accounts' )
137+ expect ( goToTableLink ?. textContent ) . toBe ( '' )
138+ const previewShell = container . querySelector < HTMLElement > ( 'tbody > tr > td > div > div' )
139+ expect ( previewShell ?. lastElementChild ?. className ) . toContain ( 'h-9' )
140+ expect ( previewShell ?. lastElementChild ?. querySelector ( 'a' ) ) . toBeNull ( )
133141 const previewCell = container . querySelector ( 'tbody > tr > td' )
134142 expect ( previewCell ?. className ) . toContain ( 'overflow-clip' )
135143 expect ( previewCell ?. className ) . toContain ( 'border-r' )
0 commit comments