Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: test case for JournalTools #10656

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0dcb820
Sync with master to get latest update (#9750)
sandeep-deriv Aug 18, 2023
c20f2e4
Revert "Sync with master to get latest update (#9750)"
vinu-deriv Aug 25, 2023
29cdf1a
Merge remote-tracking branch 'upstream/master' into test-coverage-dbot
vinu-deriv Aug 25, 2023
2004d97
Merge remote-tracking branch 'upstream/master' into test-coverage-dbot
vinu-deriv Aug 30, 2023
5e375e3
Shafin/bot 531/chore toolbar widget test (#9883)
shafin-deriv Aug 30, 2023
19636ae
chore: contract card loading tests (#9884)
shafin-deriv Aug 30, 2023
c0af2a9
Farabi/bot 533/contract result overlay test case (#9886)
farabi-deriv Aug 30, 2023
0bd3369
Maryia/Bot-535/test: react-joyride-wrapper component (#9893)
maryia-matskevich-deriv Aug 30, 2023
bb18864
test: search-icon (#9891)
maryia-matskevich-deriv Aug 30, 2023
8e2e0e3
Maryia/BOT-537/test: RunStrategy (#9892)
maryia-matskevich-deriv Aug 30, 2023
75eadce
Farabi/bot 536/test case for icon button (#9888)
farabi-deriv Aug 30, 2023
06092c1
Vinu/bot 519/bot notification messages test case (#9881)
vinu-deriv Aug 30, 2023
9989ec6
fix: removed unused component (#9873)
rupato-deriv Sep 8, 2023
0bf7fa4
chore: test case for BotPreview (#9951)
shafin-deriv Sep 8, 2023
3a4054e
Merge branch 'master' of github.com:binary-com/deriv-app into test-co…
sandeep-deriv Sep 14, 2023
3bc95b7
Merge remote-tracking branch 'upstream/master' into test-coverage-dbot
vinu-deriv Sep 22, 2023
f8617fb
chore: write test case for icon-radio.tsx (#10185)
shafin-deriv Sep 25, 2023
955cc39
chore: dashboard local footer test (#10234)
shafin-deriv Sep 25, 2023
72d25bf
chore: test case for recent-footer (#10260)
shafin-deriv Sep 25, 2023
146af79
Farabi/bot 634/test case for bot stop modal (#10112)
farabi-deriv Sep 25, 2023
81e42e0
Merge remote-tracking branch 'upstream/master' into test-coverage-dbot
vinu-deriv Oct 10, 2023
969e6b0
Farabi/bot-635/test case for workspace control (#10408)
farabi-deriv Oct 10, 2023
172e5be
Farabi/bot 680/test case for flyout block (#10546)
farabi-deriv Oct 10, 2023
388ac3d
test: add test case for flyout-text component, convert to ts (#10548)
maryia-matskevich-deriv Oct 10, 2023
3468225
chore: add test case for date-item.tsx (#10528)
shafin-deriv Oct 10, 2023
574fb22
Shafin/bot 685/chore filter dialog test case (#10540)
shafin-deriv Oct 10, 2023
d2e30e2
Maryia/BOT-683/test: add test case for flyout-video.jsx (#10554)
maryia-matskevich-deriv Oct 10, 2023
95d4009
Maryia/Bot-681/test: add test case for flyout-img.jsx (#10533)
maryia-matskevich-deriv Oct 10, 2023
53c34e7
chore: test case for JournalTools
shafin-deriv Oct 13, 2023
d30820e
chore: remove smartchart mock
shafin-deriv Oct 13, 2023
4f6e7d8
Merge branch 'master' into shafin/BOT-689/chore--journal-tools-test-case
vinu-deriv Oct 19, 2023
4883c88
Merge remote-tracking branch 'upstream/master' into shafin/BOT-689/ch…
shafin-deriv Oct 20, 2023
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 @@ -32,7 +32,7 @@ const mockProps = {
toggleFilterDialog: jest.fn(),
};

describe('Draggable', () => {
describe('FilterDialog', () => {
let wrapper: ({ children }: { children: JSX.Element }) => JSX.Element, mock_DBot_store: RootStore | undefined;

beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import { mockStore, StoreProvider } from '@deriv/stores';
// eslint-disable-next-line import/no-extraneous-dependencies
import { render, screen } from '@testing-library/react';
// eslint-disable-next-line import/no-extraneous-dependencies
import { mock_ws } from 'Utils/mock';
import { DBotStoreProvider, mockDBotStore } from 'Stores/useDBotStore';
import JournalTools from '../journal-tools';

jest.mock('@deriv/bot-skeleton/src/scratch/blockly', () => jest.fn());
jest.mock('@deriv/bot-skeleton/src/scratch/dbot', () => ({
saveRecentWorkspace: jest.fn(),
unHighlightAllBlocks: jest.fn(),
}));
jest.mock('@deriv/bot-skeleton/src/scratch/hooks/block_svg', () => jest.fn());

const mockProps = {
toggle_ref: { current: null },
checked_filters: { error: ['test error'], notify: ['test notify'], success: ['test success'] },
filters: [
{ id: 'error', label: 'Errors' },
{ id: 'notify', label: 'Notifications' },
{ id: 'success', label: 'System' },
],
is_filter_dialog_visible: true,
filterMessage: jest.fn(),
toggleFilterDialog: jest.fn(),
};

describe('JournalTools', () => {
let wrapper: ({ children }: { children: JSX.Element }) => JSX.Element;
const mock_store = mockStore({});
const mock_DBot_store = mockDBotStore(mock_store, mock_ws);

beforeAll(() => {
wrapper = ({ children }: { children: JSX.Element }) => (
<StoreProvider store={mock_store}>
<DBotStoreProvider ws={mock_ws} mock={mock_DBot_store}>
{children}
</DBotStoreProvider>
</StoreProvider>
);
});

test('should renders JournalTools', () => {
const { container } = render(<JournalTools {...mockProps} />, {
wrapper,
});
expect(container).toBeInTheDocument();
});

test('should renders filter options that is passed as prop', () => {
render(<JournalTools {...mockProps} />, {
wrapper,
});
expect(screen.getByText('Notifications')).toBeInTheDocument();
});
});