@@ -24,23 +24,32 @@ describe('ClusterMenu', () => {
2424 const getMenuItems = ( ) => screen . getAllByRole ( 'menuitem' ) ;
2525 const getMenuItem = ( ) => screen . getByRole ( 'menuitem' ) ;
2626 const getBrokers = ( ) => screen . getByTitle ( 'Brokers' ) ;
27- const getTopics = ( ) => screen . getByTitle ( 'Brokers ' ) ;
28- const getConsumers = ( ) => screen . getByTitle ( 'Brokers ' ) ;
27+ const getTopics = ( ) => screen . getByTitle ( 'Topics ' ) ;
28+ const getConsumers = ( ) => screen . getByTitle ( 'Consumers ' ) ;
2929 const getKafkaConnect = ( ) => screen . getByTitle ( 'Kafka Connect' ) ;
3030 const getCluster = ( ) => screen . getByText ( onlineClusterPayload . name ) ;
3131
32+ // Хелпер для клика по шеврону - ищем SVG с шевроном
33+ const clickChevron = async ( ) => {
34+ const chevronSvg = document . querySelector ( 'svg[viewBox="0 0 10 6"]' ) ;
35+ if ( chevronSvg ) {
36+ await userEvent . click ( chevronSvg as Element ) ;
37+ }
38+ } ;
39+
3240 it ( 'renders cluster menu with default set of features' , async ( ) => {
3341 render ( setupComponent ( onlineClusterPayload ) ) ;
3442 expect ( getCluster ( ) ) . toBeInTheDocument ( ) ;
3543
3644 expect ( getMenuItems ( ) . length ) . toEqual ( 1 ) ;
37- await userEvent . click ( getMenuItem ( ) ) ;
45+ await clickChevron ( ) ;
3846 expect ( getMenuItems ( ) . length ) . toEqual ( 4 ) ;
3947
4048 expect ( getBrokers ( ) ) . toBeInTheDocument ( ) ;
4149 expect ( getTopics ( ) ) . toBeInTheDocument ( ) ;
4250 expect ( getConsumers ( ) ) . toBeInTheDocument ( ) ;
4351 } ) ;
52+
4453 it ( 'renders cluster menu with correct set of features' , async ( ) => {
4554 render (
4655 setupComponent ( {
@@ -53,7 +62,7 @@ describe('ClusterMenu', () => {
5362 } )
5463 ) ;
5564 expect ( getMenuItems ( ) . length ) . toEqual ( 1 ) ;
56- await userEvent . click ( getMenuItem ( ) ) ;
65+ await clickChevron ( ) ;
5766 expect ( getMenuItems ( ) . length ) . toEqual ( 7 ) ;
5867
5968 expect ( getBrokers ( ) ) . toBeInTheDocument ( ) ;
@@ -63,6 +72,7 @@ describe('ClusterMenu', () => {
6372 expect ( getKafkaConnect ( ) ) . toBeInTheDocument ( ) ;
6473 expect ( screen . getByTitle ( 'KSQL DB' ) ) . toBeInTheDocument ( ) ;
6574 } ) ;
75+
6676 it ( 'renders open cluster menu' , ( ) => {
6777 render ( setupComponent ( onlineClusterPayload , true ) , {
6878 initialEntries : [ clusterConnectorsPath ( onlineClusterPayload . name ) ] ,
@@ -74,6 +84,7 @@ describe('ClusterMenu', () => {
7484 expect ( getTopics ( ) ) . toBeInTheDocument ( ) ;
7585 expect ( getConsumers ( ) ) . toBeInTheDocument ( ) ;
7686 } ) ;
87+
7788 it ( 'makes Kafka Connect link active' , async ( ) => {
7889 render (
7990 setupComponent ( {
@@ -83,7 +94,7 @@ describe('ClusterMenu', () => {
8394 { initialEntries : [ clusterConnectorsPath ( onlineClusterPayload . name ) ] }
8495 ) ;
8596 expect ( getMenuItems ( ) . length ) . toEqual ( 1 ) ;
86- await userEvent . click ( getMenuItem ( ) ) ;
97+ await clickChevron ( ) ;
8798 expect ( getMenuItems ( ) . length ) . toEqual ( 5 ) ;
8899
89100 const kafkaConnect = getKafkaConnect ( ) ;
0 commit comments