forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bleve_settings.test.jsx
49 lines (44 loc) · 1.29 KB
/
bleve_settings.test.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import BleveSettings from 'components/admin_console/bleve_settings.jsx';
jest.mock('actions/admin_actions.jsx', () => {
return {
blevePurgeIndexes: jest.fn(),
};
});
describe('components/BleveSettings', () => {
test('should match snapshot, disabled', () => {
const config = {
BleveSettings: {
IndexDir: '',
EnableIndexing: false,
EnableSearching: false,
EnableAutocomplete: false,
},
};
const wrapper = shallow(
<BleveSettings
config={config}
/>,
);
expect(wrapper).toMatchSnapshot();
});
test('should match snapshot, enabled', () => {
const config = {
BleveSettings: {
IndexDir: 'bleve.idx',
EnableIndexing: true,
EnableSearching: false,
EnableAutocomplete: false,
},
};
const wrapper = shallow(
<BleveSettings
config={config}
/>,
);
expect(wrapper).toMatchSnapshot();
});
});