@@ -20,6 +20,8 @@ vi.mock("./agents/agent_card_grid", () => ({
2020 ) ,
2121} ) ) ;
2222
23+ // Note: agents.tsx no longer uses AgentCardGrid — it renders a Table directly.
24+
2325vi . mock ( "./agents/agent_info" , ( ) => ( {
2426 default : ( ) => < div data-testid = "agent-info" /> ,
2527} ) ) ;
@@ -54,19 +56,19 @@ describe("AgentsPanel", () => {
5456 expect ( screen . queryByText ( "+ Add New Agent" ) ) . not . toBeInTheDocument ( ) ;
5557 } ) ;
5658
57- it ( "should pass isAdmin=true to AgentCardGrid for admin role" , async ( ) => {
59+ it ( "should show Actions column header for admin role" , async ( ) => {
5860 render ( < AgentsPanel accessToken = "test-token" userRole = "Admin" /> ) ;
5961 await waitFor ( ( ) => {
60- const grid = screen . getByTestId ( "agent-card-grid" ) ;
61- expect ( grid ) . toHaveAttribute ( "data-is-admin" , "true" ) ;
62+ expect ( screen . getByRole ( "columnheader" , { name : / a c t i o n s / i } ) ) . toBeInTheDocument ( ) ;
6263 } ) ;
6364 } ) ;
6465
65- it ( "should pass isAdmin=false to AgentCardGrid for internal user role" , async ( ) => {
66+ it ( "should not show Actions column header for internal user role" , async ( ) => {
6667 render ( < AgentsPanel accessToken = "test-token" userRole = "Internal User" /> ) ;
6768 await waitFor ( ( ) => {
68- const grid = screen . getByTestId ( "agent-card-grid" ) ;
69- expect ( grid ) . toHaveAttribute ( "data-is-admin" , "false" ) ;
69+ expect ( screen . queryByRole ( "columnheader" , { name : / a c t i o n s / i } ) ) . not . toBeInTheDocument ( ) ;
70+ // confirm table is rendered (not still loading)
71+ expect ( screen . getByRole ( "table" ) ) . toBeInTheDocument ( ) ;
7072 } ) ;
7173 } ) ;
7274
0 commit comments