mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
## Context Deploys the trusted partner changes from the following PRs: - https://github.com/supabase/supabase/pull/54006 - https://github.com/supabase/supabase/pull/53583 - https://github.com/supabase/supabase/pull/53705 - https://github.com/supabase/supabase/pull/53917 - https://github.com/supabase/supabase/pull/54507 - https://github.com/supabase/supabase/pull/54506 --------- Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import { fireEvent, screen } from '@testing-library/react'
|
|
import { mockAnimationsApi } from 'jsdom-testing-mocks'
|
|
import { expect, test } from 'vitest'
|
|
|
|
import { JitDbAccessConfiguration } from './JitDbAccessConfiguration'
|
|
import { mockAccess } from './JitDbAccessConfiguration.test-fixtures'
|
|
import { createMockAuthContext } from '@/tests/lib/auth-helpers'
|
|
import { customRender } from '@/tests/lib/custom-render'
|
|
import { createMockProfileContext } from '@/tests/lib/profile-helpers'
|
|
|
|
mockAnimationsApi()
|
|
|
|
test('keeps member token access usable without checking platform apps when self-hosted', async () => {
|
|
mockAccess()
|
|
customRender(<JitDbAccessConfiguration />, {
|
|
profileContext: createMockProfileContext(),
|
|
authContext: createMockAuthContext(),
|
|
})
|
|
|
|
const toggle = await screen.findByRole('switch')
|
|
expect(await screen.findByText('member-0@example.com')).toBeInTheDocument()
|
|
expect(toggle).toHaveAttribute('aria-busy', 'false')
|
|
expect(toggle).toBeEnabled()
|
|
expect(screen.queryByRole('heading', { name: 'Apps' })).not.toBeInTheDocument()
|
|
expect(screen.queryByText('Loading authorized apps...')).not.toBeInTheDocument()
|
|
|
|
fireEvent.click(toggle)
|
|
expect(await screen.findByRole('alertdialog')).toHaveTextContent('Disable token access')
|
|
})
|