Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

added failing query params tests

TzeYiingc55adaece624
diff --git a/studio/tests/pages/projects/logs.test.js b/studio/tests/pages/projects/logs.test.js
index b6c4b1bba04..089b432f055 100644
--- a/studio/tests/pages/projects/logs.test.js
+++ b/studio/tests/pages/projects/logs.test.js
@@ -162,4 +162,26 @@ test("where clause will trigger a log refresh", async () => {
}, { timeout: 1000 })
await waitFor(() => screen.getByText(/happened/))
-})
\ No newline at end of file
+})
+test('search= query param will populate the search bar', async () => {
+ useRouter.mockReturnValue({
+ query: { ref: '123', type: 'api', search: 'someSearch' },
+ })
+ render(<LogPage />)
+ // should populate input with the search query param
+ screen.getByDisplayValue('someSearch')
+})
+
+test('query= query param will populate the query input', async () => {
+ useRouter.mockReturnValue({
+ query: { ref: '123', type: 'api', query: 'some query', search: 'someSearch' },
+ })
+ render(<LogPage />)
+ // should populate input with the search query param
+ screen.getByText(/some query/)
+ let editor = container.querySelector('.monaco-editor')
+ expect(editor).toBeTruthy()
+ screen.getByText(/some query/)
+ // query takes precedence of search queryparam
+ expect(() => screen.getByDisplayValue(/someSearch/)).toThrow()
+})