mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
chore(kubernetes): Migrate Helm Templates View to React R8S-239 (#587)
This commit is contained in:
parent
ad89df4d0d
commit
264ff5457b
20 changed files with 635 additions and 372 deletions
|
@ -6,14 +6,16 @@ import { withUserProvider } from '@/react/test-utils/withUserProvider';
|
|||
import { withTestRouter } from '@/react/test-utils/withRouter';
|
||||
import { UserViewModel } from '@/portainer/models/user';
|
||||
|
||||
import { Chart } from '../types';
|
||||
|
||||
import { HelmTemplatesList } from './HelmTemplatesList';
|
||||
import { Chart } from './HelmTemplatesListItem';
|
||||
|
||||
// Sample test data
|
||||
const mockCharts: Chart[] = [
|
||||
{
|
||||
name: 'test-chart-1',
|
||||
description: 'Test Chart 1 Description',
|
||||
repo: 'https://example.com',
|
||||
annotations: {
|
||||
category: 'database',
|
||||
},
|
||||
|
@ -21,6 +23,7 @@ const mockCharts: Chart[] = [
|
|||
{
|
||||
name: 'test-chart-2',
|
||||
description: 'Test Chart 2 Description',
|
||||
repo: 'https://example.com',
|
||||
annotations: {
|
||||
category: 'database',
|
||||
},
|
||||
|
@ -28,6 +31,7 @@ const mockCharts: Chart[] = [
|
|||
{
|
||||
name: 'nginx-chart',
|
||||
description: 'Nginx Web Server',
|
||||
repo: 'https://example.com',
|
||||
annotations: {
|
||||
category: 'web',
|
||||
},
|
||||
|
@ -38,7 +42,6 @@ const selectActionMock = vi.fn();
|
|||
|
||||
function renderComponent({
|
||||
loading = false,
|
||||
titleText = 'Test Helm Templates',
|
||||
charts = mockCharts,
|
||||
selectAction = selectActionMock,
|
||||
} = {}) {
|
||||
|
@ -48,7 +51,6 @@ function renderComponent({
|
|||
withTestRouter(() => (
|
||||
<HelmTemplatesList
|
||||
loading={loading}
|
||||
titleText={titleText}
|
||||
charts={charts}
|
||||
selectAction={selectAction}
|
||||
/>
|
||||
|
@ -68,7 +70,7 @@ describe('HelmTemplatesList', () => {
|
|||
renderComponent();
|
||||
|
||||
// Check for the title
|
||||
expect(screen.getByText('Test Helm Templates')).toBeInTheDocument();
|
||||
expect(screen.getByText('Helm chart')).toBeInTheDocument();
|
||||
|
||||
// Check for charts
|
||||
expect(screen.getByText('test-chart-1')).toBeInTheDocument();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue