mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
- add new [OrgSelector](https://github.com/supabase/supabase/pull/43238/changes#diff-214b339101a9c06864ea2755ac7246eb4c971ce74c5d3169b1385a28ee1d4227) and [ProjectBranchSelector](https://github.com/supabase/supabase/pull/43238/changes#diff-82d25c128c306b61bea7481026f58f670a229874f23ca3a1a1d78ddeabde21e0) components to the mobile navigation, replacing the previous which took up a lot of horizontal space - org/project/branch dropdowns now open up in the bottom MobileSheetNav for a better mobile ux - desktop nav remains unchanged
24 lines
1.1 KiB
TypeScript
24 lines
1.1 KiB
TypeScript
import { sanitizeRoute } from 'components/layouts/AppLayout/ProjectDropdown.utils'
|
|
import { expect, test } from 'vitest'
|
|
|
|
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'
|
|
)
|
|
expect(
|
|
sanitizeRoute('/project/[ref]/advisors/security/[preset]', { ref: 'abc', preset: 'auth' })
|
|
).toBe('/project/[ref]/advisors/security')
|
|
})
|