Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('EnterpriseComplianceCards', () => {

const loadingText = screen.getByText('Loading…');
expect(loadingText).toBeInTheDocument();
expect(loadingText.className).toContain('text-gray-500');
expect(loadingText.className).toContain('text-muted-foreground');
});

it('renders success state and navigates on click', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('CreateNamespaceModal', () => {
expect(screen.getAllByRole('combobox').length).toBeGreaterThan(0)
})

it('initializes with cluster placeholder selected', () => {
it('auto-selects first cluster on initialization', () => {
render(
<CreateNamespaceModal
clusters={clusters}
Expand All @@ -74,7 +74,7 @@ describe('CreateNamespaceModal', () => {

const comboboxes = screen.getAllByRole('combobox')
expect(comboboxes.length).toBeGreaterThan(0)
expect((comboboxes[0] as HTMLSelectElement).value).toBe('')
expect((comboboxes[0] as HTMLSelectElement).value).toBe('cluster-1')
Comment on lines 75 to +77
})

it('allows cluster selection change', async () => {
Expand Down
11 changes: 5 additions & 6 deletions web/src/components/rbac/__tests__/CanIChecker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ describe('CanIChecker — Initial Rendering', () => {
const clusterSelect = screen.getByTestId('can-i-cluster') as HTMLSelectElement
const options = Array.from(clusterSelect.options)

expect(options).toHaveLength(3)
expect(options[0].value).toBe('')
expect(options[1].value).toBe('cluster-a')
expect(options[2].value).toBe('cluster-b')
expect(options).toHaveLength(2)
expect(options[0].value).toBe('cluster-a')
expect(options[1].value).toBe('cluster-b')
})

it('populates namespace dropdown with fetched namespaces', () => {
Expand All @@ -120,11 +119,11 @@ describe('CanIChecker — Initial Rendering', () => {
expect(options.some(opt => opt.value === 'kube-system')).toBe(true)
})

it('starts with no cluster selected', () => {
it('auto-selects first cluster on load', () => {
render(<CanIChecker />)

const clusterSelect = screen.getByTestId('can-i-cluster') as HTMLSelectElement
expect(clusterSelect.value).toBe('')
expect(clusterSelect.value).toBe('cluster-a')
})

it('defaults verb and resource to common values', () => {
Expand Down
Loading