|
1 | 1 | import { SelectableValue } from '@grafana/data';
|
2 | 2 | import { render, screen } from '@testing-library/react';
|
3 |
| -import { configureStore } from 'gcopypaste/app/store/configureStore'; |
4 | 3 | import React, { SyntheticEvent } from 'react';
|
5 |
| -import { Provider } from 'react-redux'; |
6 |
| - |
7 |
| -// removed and hacked in gcopypaste |
8 |
| -// import { configureStore } from '../../../../store/configureStore'; |
9 | 4 |
|
10 | 5 | import { getValueFromEventItem, PromSettings } from './PromSettings';
|
11 | 6 | import { createDefaultConfigOptions } from './mocks';
|
@@ -46,42 +41,24 @@ describe('PromSettings', () => {
|
46 | 41 | const options = defaultProps;
|
47 | 42 | options.url = '';
|
48 | 43 | options.jsonData.httpMethod = '';
|
49 |
| - const store = configureStore(); |
50 | 44 |
|
51 |
| - render( |
52 |
| - <Provider store={store}> |
53 |
| - {/* @ts-ignore until we get the tests working */} |
54 |
| - <PromSettings onOptionsChange={() => {}} options={options} /> |
55 |
| - </Provider> |
56 |
| - ); |
| 45 | + render(<PromSettings onOptionsChange={() => {}} options={options} />); |
57 | 46 | expect(screen.getByText('POST')).toBeInTheDocument();
|
58 | 47 | });
|
59 | 48 | it('should show POST httpMethod if POST httpMethod is configured', () => {
|
60 | 49 | const options = defaultProps;
|
61 | 50 | options.url = 'test_url';
|
62 | 51 | options.jsonData.httpMethod = 'POST';
|
63 |
| - const store = configureStore(); |
64 | 52 |
|
65 |
| - render( |
66 |
| - <Provider store={store}> |
67 |
| - {/* @ts-ignore until we get the tests working */} |
68 |
| - <PromSettings onOptionsChange={() => {}} options={options} /> |
69 |
| - </Provider> |
70 |
| - ); |
| 53 | + render(<PromSettings onOptionsChange={() => {}} options={options} />); |
71 | 54 | expect(screen.getByText('POST')).toBeInTheDocument();
|
72 | 55 | });
|
73 | 56 | it('should show GET httpMethod if GET httpMethod is configured', () => {
|
74 | 57 | const options = defaultProps;
|
75 | 58 | options.url = 'test_url';
|
76 | 59 | options.jsonData.httpMethod = 'GET';
|
77 |
| - const store = configureStore(); |
78 | 60 |
|
79 |
| - render( |
80 |
| - <Provider store={store}> |
81 |
| - {/* @ts-ignore until we get the tests working */} |
82 |
| - <PromSettings onOptionsChange={() => {}} options={options} /> |
83 |
| - </Provider> |
84 |
| - ); |
| 61 | + render(<PromSettings onOptionsChange={() => {}} options={options} />); |
85 | 62 | expect(screen.getByText('GET')).toBeInTheDocument();
|
86 | 63 | });
|
87 | 64 | });
|
|
0 commit comments