trying to do testing for the Post API call wherein the response is xml data. And also trying to achieve the passing of the test case
below is the code to resolve
describe('CardDesignTestPage', () => {
test('fetches XML data and allows user to continue', async () => {
userEvent.setup();
const promise = Promise.resolve(<xml>...</xml>);
axios.post.mockImplementationOnce(() => promise);
await waitFor(() => promise)
render(
<CardDesignTestPage />
)
userEvent.change(screen.getByRole('textbox'), { target: { value: <xml>...</xml> } })
})
})
