From 219ba0d3e2505428af23d692fafeb477b9ca911e Mon Sep 17 00:00:00 2001 From: Jakub Jankowski Date: Wed, 20 Dec 2023 18:11:58 -0600 Subject: [PATCH] test: add test --- .../components/Docs/HttpOperation/HttpOperation.spec.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/elements-core/src/components/Docs/HttpOperation/HttpOperation.spec.tsx b/packages/elements-core/src/components/Docs/HttpOperation/HttpOperation.spec.tsx index 6960f112a..17f8a4385 100644 --- a/packages/elements-core/src/components/Docs/HttpOperation/HttpOperation.spec.tsx +++ b/packages/elements-core/src/components/Docs/HttpOperation/HttpOperation.spec.tsx @@ -621,11 +621,20 @@ describe('HttpOperation', () => { it('should display callback operation', async () => { const { unmount } = render(); + const serversButton = screen.getByRole('button', { name: /server/i }); + userEvent.click(serversButton); + + const enableItem = screen.getByRole('menuitemradio', { name: /development/i }); + userEvent.click(enableItem); + + expect(serversButton).toHaveTextContent('Development'); + //operation name expect(screen.queryByText('newPet')).toBeInTheDocument(); // operation header expect(screen.queryByText('{$request.body#/newPetAvailableUrl}')).toBeInTheDocument(); + expect(screen.queryAllByText(/https:\/\/todos-dev.stoplight.io/).length).toEqual(1); // server url visible only in the main operation header, not in callback // operation body expect(screen.queryByText('Callback body description')).toBeInTheDocument();