mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 09:44:19 +08:00
* Move all studio files from /studio to /apps/studio. * Move studio specific prettier ignores. * Fix the ui references from studio. * Fix the css imports. * Fix all package.json issues. * Fix the prettier setup for the studio app. * Add .turbo folder to prettierignore. * Fix the github workflows.
20 lines
917 B
TypeScript
20 lines
917 B
TypeScript
import { sanitizeRoute } from 'components/layouts/AppLayout/ProjectDropdown'
|
|
|
|
test('Should sanitize project routes correctly when switching projects by removing project specific parameters', () => {
|
|
expect(sanitizeRoute('/project/[ref]', { ref: 'abc' })).toBe('/project/[ref]')
|
|
expect(sanitizeRoute('/project/[ref]/editor', { ref: 'abc' })).toBe('/project/[ref]/editor')
|
|
expect(sanitizeRoute('/project/[ref]/storage/buckets', { ref: 'abc' })).toBe(
|
|
'/project/[ref]/storage/buckets'
|
|
)
|
|
|
|
expect(sanitizeRoute('/project/[ref]/editor/[tableId]', { ref: 'abc', tableId: '10' })).toBe(
|
|
'/project/[ref]/editor'
|
|
)
|
|
expect(
|
|
sanitizeRoute('/project/[ref]/storage/buckets/[bucketId]', { ref: 'abc', bucketId: 'bucket-1' })
|
|
).toBe('/project/[ref]/storage/buckets')
|
|
expect(sanitizeRoute('/project/[ref]/logs/explorer?q=select', { ref: 'abc' })).toBe(
|
|
'/project/[ref]/logs/explorer?q=select'
|
|
)
|
|
})
|