Skip to content

Commit b81f0a0

Browse files
committed
Renamed DragAndDrop
1 parent 6a44b63 commit b81f0a0

File tree

3 files changed

+63
-714
lines changed

3 files changed

+63
-714
lines changed

__tests__/BottomTabs.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useReducer } from 'react';
1+
import React from 'react';
22
import { Provider } from 'react-redux';
33
import '@testing-library/jest-dom';
44
import { render, screen } from '@testing-library/react';

__tests__/DragAndDrop.test.tsx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import React from 'react';
2+
import '@testing-library/jest-dom';
3+
import { DndProvider } from 'react-dnd';
4+
import { HTML5Backend } from 'react-dnd-html5-backend';
5+
import { render, screen } from '@testing-library/react';
6+
import DragDropPanel from '../app/src/components/left/DragDropPanel';
7+
import { Provider } from 'react-redux';
8+
import store from '../app/src/redux/store';
9+
10+
describe('Drag and Drop Side Panel', () => {
11+
test('Renders all HTML Element choices', () => {
12+
render(
13+
<Provider store={store}>
14+
<DndProvider backend={HTML5Backend}>
15+
<DragDropPanel />
16+
</DndProvider>
17+
</Provider>
18+
);
19+
expect(screen.getByText('Div')).toBeInTheDocument();
20+
expect(screen.getByText('Img')).toBeInTheDocument();
21+
expect(screen.getByText('Form')).toBeInTheDocument();
22+
expect(screen.getByText('Button')).toBeInTheDocument();
23+
expect(screen.getByText('Link')).toBeInTheDocument();
24+
expect(screen.getByText('Paragraph')).toBeInTheDocument();
25+
expect(screen.getByText('Header 1')).toBeInTheDocument();
26+
expect(screen.getByText('Header 2')).toBeInTheDocument();
27+
expect(screen.getByText('Span')).toBeInTheDocument();
28+
expect(screen.getByText('Input')).toBeInTheDocument();
29+
expect(screen.getByText('Label')).toBeInTheDocument();
30+
expect(screen.getByText('Ordered List')).toBeInTheDocument();
31+
expect(screen.getByText('Unordered List')).toBeInTheDocument();
32+
expect(screen.getByText('Menu')).toBeInTheDocument();
33+
expect(screen.getByText('List')).toBeInTheDocument();
34+
expect(screen.queryByText('separator')).toBe(null);
35+
});
36+
37+
test('Renders all React Router Component choices', () => {
38+
render(
39+
<Provider store={store}>
40+
<DndProvider backend={HTML5Backend}>
41+
<DragDropPanel />
42+
</DndProvider>
43+
</Provider>
44+
);
45+
46+
expect(screen.getByText('Switch')).toBeInTheDocument();
47+
expect(screen.getByText('Route')).toBeInTheDocument();
48+
expect(screen.getByText('LinkTo')).toBeInTheDocument();
49+
});
50+
51+
// test('Adds new custom element', () => {
52+
// render(<Test />);
53+
// fireEvent.change(screen.getAllByRole('textbox')[0], {
54+
// target: { value: 'Testing' }
55+
// });
56+
// fireEvent.change(screen.getAllByRole('textbox')[1], {
57+
// target: { value: 'Testing' }
58+
// });
59+
// fireEvent.click(screen.getByDisplayValue('Add Element'));
60+
// expect(screen.getByText('Testing')).toBeInTheDocument();
61+
// });
62+
});

0 commit comments

Comments
 (0)