chore: add failing test for expandable api request table

This commit is contained in:
TzeYiing committed 2023-05-02 15:53:29 +09:00
1 parent 10b822d010
commit f3722bd9b7
1 file changed
+13
@@ -26,3 +26,16 @@ test('refresh button', async () => {
userEvent.click(await screen.findByText(/Refresh/))
await waitFor(() => expect(get).toBeCalled())
})
test('expandable tables', async () => {
get.mockImplementation(async (_url) => [
{ data: [{ timestamp: new Date().toISOString(), count: 123 }] },
])
const expandables = await screen.findByText('View API requests')
const first = expandables[0]
get.mockImplementationOnce(async (_url) => [{ data: [{ path: '/my-path', count: 22 }] }])
userEvent.click(first)
await screen.findByText('Hide API Requests')
await screen.findByText(/\/my\-path/)
await screen.findByText(/22/)
})