Skip to content

Commit

Permalink
fix: fix failing tests (deriv-com#9521)
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-deriv authored Aug 1, 2023
1 parent 1c7b78e commit a69c685
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/p2p/src/components/buy-sell/__tests__/buy-sell.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useStores } from 'Stores/index';
import BuySell from '../buy-sell';

const mock_store = {

general_store: {
should_show_popup: false,
},
Expand All @@ -25,12 +24,24 @@ jest.mock('Stores', () => ({
useStores: jest.fn(() => mock_store),
}));

jest.mock('@sendbird/chat', () => ({
SendbirdChat: jest.fn().mockReturnValue({}),
}));

jest.mock('@sendbird/chat/groupChannel', () => ({
SendbirdChat: jest.fn().mockReturnValue({}),
}));

jest.mock('@sendbird/chat/message', () => ({
SendbirdChat: jest.fn().mockReturnValue({}),
}));

describe('<BuySellPage/>', () => {
it('should render Verification Section when user is not verified', () => {
render(<BuySell />);

expect(screen.getByText("Verification")).toBeInTheDocument();
expect(screen.getByText("Verification Section")).toBeInTheDocument();
expect(screen.getByText('Verification')).toBeInTheDocument();
expect(screen.getByText('Verification Section')).toBeInTheDocument();
});
it('should not render the page return section when nickname form is open ', () => {
useStores.mockReturnValue({
Expand Down

0 comments on commit a69c685

Please sign in to comment.