From 285753211da3b18946efde34cae75c4475617991 Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Mon, 22 Jul 2024 20:47:04 +0000 Subject: [PATCH] fix(test): Update broken tests --- .../Form/dataFormat/DataFormatEditor.test.tsx | 6 +- .../loadBalancer/LoadBalancerEditor.test.tsx | 6 +- .../Visualization/Canvas/CanvasForm.test.tsx | 8 +- .../Canvas/__snapshots__/Canvas.test.tsx.snap | 606 +++++++++--------- 4 files changed, 325 insertions(+), 301 deletions(-) diff --git a/packages/ui/src/components/Form/dataFormat/DataFormatEditor.test.tsx b/packages/ui/src/components/Form/dataFormat/DataFormatEditor.test.tsx index 92382ade0..95a84bfe3 100644 --- a/packages/ui/src/components/Form/dataFormat/DataFormatEditor.test.tsx +++ b/packages/ui/src/components/Form/dataFormat/DataFormatEditor.test.tsx @@ -47,7 +47,7 @@ describe('DataFormatEditor', () => { it('should render', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); @@ -59,7 +59,7 @@ describe('DataFormatEditor', () => { it('should filter candidates with a text input', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); @@ -75,7 +75,7 @@ describe('DataFormatEditor', () => { it('should clear filter and close the dropdown with close button', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); diff --git a/packages/ui/src/components/Form/loadBalancer/LoadBalancerEditor.test.tsx b/packages/ui/src/components/Form/loadBalancer/LoadBalancerEditor.test.tsx index 179d8a4d6..0f353dc22 100644 --- a/packages/ui/src/components/Form/loadBalancer/LoadBalancerEditor.test.tsx +++ b/packages/ui/src/components/Form/loadBalancer/LoadBalancerEditor.test.tsx @@ -48,7 +48,7 @@ describe('LoadBalancerEditor', () => { it('should render', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); @@ -62,7 +62,7 @@ describe('LoadBalancerEditor', () => { it('should filter candidates with a text input', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); @@ -78,7 +78,7 @@ describe('LoadBalancerEditor', () => { it('should clear filter and close the dropdown with close button', async () => { render(); - const buttons = screen.getAllByRole('button', { name: 'Menu toggle' }); + const buttons = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(buttons[0]); }); diff --git a/packages/ui/src/components/Visualization/Canvas/CanvasForm.test.tsx b/packages/ui/src/components/Visualization/Canvas/CanvasForm.test.tsx index ea30cc14c..20f36e30d 100644 --- a/packages/ui/src/components/Visualization/Canvas/CanvasForm.test.tsx +++ b/packages/ui/src/components/Visualization/Canvas/CanvasForm.test.tsx @@ -440,7 +440,7 @@ describe('CanvasForm', () => { , ); - const button = screen.getAllByRole('button', { name: 'Menu toggle' }); + const button = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(button[0]); }); @@ -497,7 +497,7 @@ describe('CanvasForm', () => { expect(camelRoute.from.steps[0].marshal!.avro).toBeUndefined(); expect(camelRoute.from.steps[0].marshal!.id).toEqual('modified'); - const button = screen.getAllByRole('button', { name: 'Menu toggle' }); + const button = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(button[0]); }); @@ -546,7 +546,7 @@ describe('CanvasForm', () => { , ); - const button = screen.getAllByRole('button', { name: 'Menu toggle' }); + const button = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(button[0]); }); @@ -603,7 +603,7 @@ describe('CanvasForm', () => { expect(camelRoute.from.steps[0].loadBalance!.weighted).toBeUndefined(); expect(camelRoute.from.steps[0].loadBalance!.id).toEqual('modified'); - const button = screen.getAllByRole('button', { name: 'Menu toggle' }); + const button = screen.getAllByRole('button', { name: 'Typeahead menu toggle' }); await act(async () => { fireEvent.click(button[0]); }); diff --git a/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap b/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap index 5c1baf688..9ea86a136 100644 --- a/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap +++ b/packages/ui/src/components/Visualization/Canvas/__snapshots__/Canvas.test.tsx.snap @@ -747,6 +747,103 @@ exports[`Canvas should render correctly 1`] = ` y="-60" /> + + + + + route-8888 + + + + + + + + + + + + + + + + + - - - - route-8888 - - - - - - - - - - - - - - - - - + /> + + + + + route-8888 + + + + + + + + + + + + + + + + + - - - - route-8888 - - - - - - - - - - - - - - - - - + /> + + + + + route-8888 + + + + + + + + + + + + + + + + + - - - - route-8888 - - - - - - - - - - - - - - - - - + />