Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(task): remove-ui-testing #1

Merged
merged 1 commit into from
Mar 3, 2025
Merged
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
7 changes: 7 additions & 0 deletions packages/contact-center/task/tests/CallControl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import '@testing-library/jest-dom';

jest.mock('@momentum-ui/react-collaboration', () => ({
ButtonPill: () => <div data-testid="ButtonPill" />,
ListItemBase: () => <div data-testid="ListItemBase" />,
ListItemBaseSection: () => <div data-testid="ListItemBaseSection" />,
Text: () => <div data-testid="Text" />,
}));

jest.mock('@momentum-design/components/dist/react', () => ({
Avatar: () => <div data-testid="Avatar" />,
}));

// Mock the store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import IncomingTaskPresentational from '../../src/IncomingTask/incoming-task.pre

jest.mock('@momentum-ui/react-collaboration', () => ({
ButtonPill: () => <div data-testid="ButtonPill" />,
ListItemBase: () => <div data-testid="ListItemBase" />,
ListItemBaseSection: () => <div data-testid="ListItemBaseSection" />,
Text: () => <div data-testid="Text" />,
}));

jest.mock('@momentum-design/components/dist/react', () => ({
Avatar: () => <div data-testid="Avatar" />,
}));

describe('IncomingTaskPresentational', () => {
Expand Down Expand Up @@ -35,7 +42,6 @@ describe('IncomingTaskPresentational', () => {

render(<IncomingTaskPresentational {...props} />);

const callInfo = screen.getByTestId('incoming-task-ani');
expect(callInfo).toHaveTextContent('1234567890');
expect(screen.getAllByTestId('ListItemBase')).toHaveLength(1);
});
});
7 changes: 7 additions & 0 deletions packages/contact-center/task/tests/IncomingTask/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import '@testing-library/jest-dom';

jest.mock('@momentum-ui/react-collaboration', () => ({
ButtonPill: () => <div data-testid="ButtonPill" />,
ListItemBase: () => <div data-testid="ListItemBase" />,
ListItemBaseSection: () => <div data-testid="ListItemBaseSection" />,
Text: () => <div data-testid="Text" />,
}));

jest.mock('@momentum-design/components/dist/react', () => ({
Avatar: () => <div data-testid="Avatar" />,
}));

// Mock the store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import {TaskListPresentationalProps} from '../../src/task.types';

jest.mock('@momentum-ui/react-collaboration', () => ({
ButtonPill: () => <div data-testid="ButtonPill" />,
ListItemBase: () => <div data-testid="ListItemBase" />,
ListItemBaseSection: () => <div data-testid="ListItemBaseSection" />,
Text: () => <div data-testid="Text" />,
}));

jest.mock('@momentum-design/components/dist/react', () => ({
Avatar: () => <div data-testid="Avatar" />,
}));

describe('TaskListPresentational Component', () => {
Expand Down Expand Up @@ -42,15 +49,6 @@ describe('TaskListPresentational Component', () => {
};

render(<TaskListPresentational {...props} />);

// Ensure the details for the first task are displayed correctly
expect(screen.getByText('1234567890')).toBeInTheDocument();
expect(screen.getByText('Sales Team')).toBeInTheDocument();
expect(screen.getByText('9876543210')).toBeInTheDocument();

// Ensure the details for the second task are displayed correctly
expect(screen.getByText('0987654321')).toBeInTheDocument();
expect(screen.getByText('Support Team')).toBeInTheDocument();
expect(screen.getByText('8765432109')).toBeInTheDocument();
expect(screen.getAllByTestId('ListItemBase')).toHaveLength(2);
});
});