foreman_webhooks 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b5922c7ae2630c642e151ea99d59e8fce67ca342a93bd595a3c80d8837db0c7
4
- data.tar.gz: c7d0bc6894477642639612f3d7b68974ea90dff25fabb91c3d684316fcd12230
3
+ metadata.gz: 3736b6b94dcf1e4b0b6fc6740f2013ae6db9844283b552bc6ac377207a4a1710
4
+ data.tar.gz: 893d4a5c19140ba592fd133775cf8a5d50aa6788f97710f9d13b955486b82835
5
5
  SHA512:
6
- metadata.gz: 3f8c365cbf5d75887f69a3ffe3c9949e4fdfff3ca3129f12432747dda722ddf017892f700eb712353a2d805e07a53ff1f82f278afe8db3ac92ef6bec802bb76a
7
- data.tar.gz: 34717dcb661c339a41377fbaa2c40603d0821bc5a0949f80abfd828497c49c9778543cd87d4505207d2e1b92cc9f684e7adca9c90eca4d854d6267dcce28a964
6
+ metadata.gz: 6fb7905519c9fc2f88ba654a37df8790d9e515677acbdab39fde0e5a36abc0fa2f7ba55ef53bdf9002c4de9fff889b2fa01e0d4d48f4d3e15c4ddff2edf20360
7
+ data.tar.gz: 6289f1f2d3eccb7c8052fdfff09305931b7553ab8b20369d4556d43b9c8c91c196bf148660e006aaad2ba922365aecaae03c8002c997564e8a30f17ffd4045e8
@@ -3,4 +3,4 @@
3
3
  proxy_feature = Feature.where(name: 'Shellhooks').first_or_create
4
4
  return unless proxy_feature.nil? || proxy_feature.errors.any?
5
5
 
6
- raise "Unable to create proxy feature: #{format_errors proxy_feature}"
6
+ raise "Unable to create proxy feature: #{SeedHelper.format_errors(proxy_feature)}"
@@ -14,7 +14,7 @@ module ForemanWebhooks
14
14
  initializer 'foreman_webhooks.register_plugin', before: :finisher_hook do |app|
15
15
  app.reloader.to_prepare do
16
16
  Foreman::Plugin.register :foreman_webhooks do
17
- requires_foreman '>= 5.0'
17
+ requires_foreman '>= 5.1'
18
18
  register_gettext
19
19
 
20
20
  apipie_documented_controllers ["#{ForemanWebhooks::Engine.root}/app/controllers/api/v2/*.rb"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanWebhooks
4
- VERSION = "6.0.0"
4
+ VERSION = '7.0.0'
5
5
  end
data/package.json CHANGED
@@ -4,11 +4,6 @@
4
4
  "description": "This plugins allows to configure Webhooks for Foreman.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "lint": "tfm-lint --plugin -d /webpack",
8
- "test": "tfm-test --plugin",
9
- "test:watch": "tfm-test --plugin --watchAll",
10
- "test:current": "tfm-test --plugin --watch",
11
- "publish-coverage": "tfm-publish-coverage",
12
7
  "create-react-component": "yo react-domain"
13
8
  },
14
9
  "repository": {
@@ -18,15 +13,8 @@
18
13
  "bugs": {
19
14
  "url": "https://projects.theforeman.org/projects/webhooks/issues"
20
15
  },
21
- "peerDependencies": {
22
- "@theforeman/vendor": "^8.15.0"
23
- },
24
16
  "devDependencies": {
25
17
  "@babel/core": "^7.7.0",
26
- "@theforeman/builder": ">= 0",
27
- "@theforeman/test": ">= 0",
28
- "@theforeman/vendor-dev": ">= 0",
29
- "@theforeman/eslint-plugin-foreman": ">= 0",
30
18
  "babel-eslint": "^10.0.0",
31
19
  "eslint": "^6.8.0",
32
20
  "eslint-plugin-spellcheck": "^0.0.17",
@@ -4,18 +4,6 @@ import '@testing-library/jest-dom';
4
4
 
5
5
  import actionCellFormatter from '../actionCellFormatter';
6
6
 
7
- jest.mock(
8
- 'foremanReact/components/common/table',
9
- () => ({
10
- cellFormatter: content => (
11
- <div data-testid="cell-formatter-mock">
12
- {content === false ? null : content}
13
- </div>
14
- ),
15
- }),
16
- { virtual: true }
17
- );
18
-
19
7
  jest.mock('../../ActionButtons/ActionButton', () => {
20
8
  // eslint-disable-next-line global-require
21
9
  const PropTypes = require('prop-types');
@@ -50,13 +38,12 @@ describe('actionCellFormatter', () => {
50
38
  jest.clearAllMocks();
51
39
  });
52
40
 
53
- it('wraps the action control in cellFormatter when rowData is present and the row is editable', () => {
41
+ it('renders the action control when rowData is present and the row is editable', () => {
54
42
  const formatter = actionCellFormatter(webhookActions);
55
43
  const row = { id: 10, name: 'Wh', can_edit: true, can_delete: true };
56
44
 
57
45
  render(formatter(null, { rowData: row }));
58
46
 
59
- expect(screen.getByTestId('cell-formatter-mock')).toBeInTheDocument();
60
47
  const action = screen.getByTestId('action-button');
61
48
  expect(action).toHaveAttribute('data-id', '10');
62
49
  expect(action).toHaveAttribute('data-name', 'Wh');
@@ -75,23 +62,22 @@ describe('actionCellFormatter', () => {
75
62
  );
76
63
  });
77
64
 
78
- it('renders falsy content through cellFormatter when rowData is present but the row is not editable', () => {
65
+ it('renders nothing when rowData is present but the row is not editable', () => {
79
66
  const formatter = actionCellFormatter(webhookActions);
80
67
  const row = { id: 5, name: 'B', can_edit: false };
81
68
 
82
- render(formatter(null, { rowData: row }));
69
+ const { container } = render(formatter(null, { rowData: row }));
83
70
 
84
- expect(screen.getByTestId('cell-formatter-mock')).toBeInTheDocument();
71
+ expect(container).toBeEmptyDOMElement();
85
72
  expect(screen.queryByTestId('action-button')).not.toBeInTheDocument();
86
73
  });
87
74
 
88
- it('returns the action control without cellFormatter when rowData is omitted', () => {
75
+ it('returns the action control when rowData is omitted', () => {
89
76
  const formatter = actionCellFormatter(webhookActions);
90
77
  const row = { id: 20, name: 'Direct', can_edit: true, canDelete: true };
91
78
 
92
79
  render(formatter(row));
93
80
 
94
- expect(screen.queryByTestId('cell-formatter-mock')).not.toBeInTheDocument();
95
81
  expect(screen.getByTestId('action-button')).toHaveAttribute(
96
82
  'data-id',
97
83
  '20'
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { cellFormatter } from 'foremanReact/components/common/table';
3
2
  import { ActionButton } from '../ActionButtons/ActionButton';
4
3
 
5
4
  const actionCellFormatter = webhookActions => (value, extra) => {
@@ -17,7 +16,7 @@ const actionCellFormatter = webhookActions => (value, extra) => {
17
16
  />
18
17
  );
19
18
 
20
- return extra?.rowData != null ? cellFormatter(content) : content;
19
+ return content;
21
20
  };
22
21
 
23
22
  export default actionCellFormatter;
@@ -46,9 +46,7 @@ const WebhookCreateModal = ({ onSuccess, onCancel, isOpen }) => {
46
46
  onSuccess();
47
47
  },
48
48
  handleError: () => setIsSubmitting(false),
49
- errorToast: ({ response }) =>
50
- // eslint-disable-next-line camelcase
51
- response?.data?.error?.full_messages?.[0] || response,
49
+ errorToast: true,
52
50
  })
53
51
  );
54
52
  };
@@ -23,9 +23,7 @@ const WebhookDeleteModal = ({ toDelete, onSuccess, modalState }) => {
23
23
  key: WEBHOOK_DELETE_MODAL_ID,
24
24
  successToast: () =>
25
25
  sprintf(__('Webhook %s was successfully deleted'), name),
26
- errorToast: response =>
27
- // eslint-disable-next-line camelcase
28
- response?.response?.data?.error?.full_messages?.[0] || response,
26
+ errorToast: true,
29
27
  handleSuccess: () => {
30
28
  setIsSubmitting(false);
31
29
  onSuccess();
@@ -73,9 +73,7 @@ const WebhookEditModal = ({ toEdit, onSuccess, modalState }) => {
73
73
  onSuccess();
74
74
  },
75
75
  handleError: () => setIsSubmitting(false),
76
- errorToast: ({ response }) =>
77
- // eslint-disable-next-line camelcase
78
- response?.data?.error?.full_messages?.[0] || response,
76
+ errorToast: true,
79
77
  })
80
78
  );
81
79
  };
@@ -31,12 +31,6 @@ const WebhookTestModal = ({ toTest, modalState }) => {
31
31
 
32
32
  const [value, setValue] = useState(initialTestValues);
33
33
 
34
- const errorToast = error =>
35
- sprintf(
36
- __('Webhook test failed: %s'),
37
- error?.response?.data?.error?.message
38
- );
39
-
40
34
  const handleSubmit = values => {
41
35
  dispatch(
42
36
  APIActions.post({
@@ -47,7 +41,8 @@ const WebhookTestModal = ({ toTest, modalState }) => {
47
41
  controller: 'webhooks',
48
42
  },
49
43
  successToast: () => sprintf(__('Webhook %s test was successful'), name),
50
- errorToast: error => errorToast(error),
44
+ errorToast: (_error, parsedMessage) =>
45
+ sprintf(__('Webhook test failed: %s'), parsedMessage),
51
46
  handleSuccess: () => modalState.closeModal(),
52
47
  })
53
48
  );
@@ -38,9 +38,10 @@ export const queryParams = {
38
38
  ...querySort,
39
39
  };
40
40
 
41
- export const stateFactory = state => ({
41
+ export const stateFactory = (state = {}, { status } = {}) => ({
42
42
  API: {
43
43
  [WEBHOOKS_API_REQUEST_KEY]: {
44
+ ...(status !== undefined && { status }),
44
45
  response: {
45
46
  ...stateParams,
46
47
  ...state,
@@ -99,12 +100,3 @@ export const spySelector = selectors => {
99
100
  selectors.selectMessage.mockImplementation(() => ({}));
100
101
  };
101
102
 
102
- export const spyEditSelector = selectors => {
103
- jest.spyOn(selectors, 'selectIsLoading');
104
- jest.spyOn(selectors, 'selectWebhookValues');
105
- jest.spyOn(selectors, 'selectWebhookTemplateId');
106
-
107
- selectors.selectIsLoading.mockImplementation(() => false);
108
- selectors.selectWebhookValues.mockImplementation(() => ({}));
109
- selectors.selectWebhookTemplateId.mockImplementation(() => 1);
110
- };
@@ -1,38 +1,132 @@
1
1
  import React from 'react';
2
- import { IntegrationTestHelper } from '@theforeman/test';
3
- import { Router } from 'react-router-dom';
4
- import { createMemoryHistory } from 'history';
5
- import {
6
- reducers as foremanApiReducers,
7
- APIMiddleware,
8
- } from 'foremanReact/redux/API';
9
-
10
- import ConnectedWebhooksIndexPage from '../WebhooksIndexPage';
11
-
12
- import * as selectors from '../../WebhooksPageSelectors';
13
- import * as editSelectors from '../Components/WebhookEditModalSelectors';
14
- import { spySelector, spyEditSelector } from './WebhooksIndexPage.fixtures';
15
-
16
- spySelector(selectors);
17
- spyEditSelector(editSelectors);
18
-
19
- describe('WebhooksIndexPage - Integration Test', () => {
20
- it('should flow', () => {
21
- const history = createMemoryHistory();
22
- history.push({ pathname: '/webhooks', search: '' });
23
-
24
- const integrationTestHelper = new IntegrationTestHelper(
25
- foremanApiReducers,
26
- [APIMiddleware]
2
+ import { screen } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ import { MemoryRouter } from 'react-router-dom';
5
+ import '@testing-library/jest-dom';
6
+
7
+ import { rtlHelpers } from 'foremanReact/common/rtlTestHelpers';
8
+ import { API } from 'foremanReact/redux/API';
9
+
10
+ jest.mock('foremanReact/redux/API/API');
11
+
12
+ import WebhooksIndexPage from '../WebhooksIndexPage';
13
+ import { WEBHOOKS_API_PLAIN_PATH } from '../../constants';
14
+
15
+ const { renderWithStoreAndI18n } = rtlHelpers;
16
+
17
+ const webhooksApiResponse = {
18
+ data: {
19
+ results: [
20
+ {
21
+ id: 1,
22
+ name: 'my-webhook',
23
+ target_url: 'https://my-machine.example.com',
24
+ can_edit: true,
25
+ can_delete: true,
26
+ enabled: true,
27
+ },
28
+ {
29
+ id: 2,
30
+ name: 'your-webhook',
31
+ target_url: 'https://your-machine.example.com',
32
+ can_edit: false,
33
+ can_delete: false,
34
+ enabled: false,
35
+ },
36
+ ],
37
+ page: 1,
38
+ per_page: 20,
39
+ subtotal: 2,
40
+ total: 2,
41
+ search: '',
42
+ can_create: true,
43
+ },
44
+ };
45
+
46
+ const webhookTemplatesApiResponse = {
47
+ data: {
48
+ results: [{ id: 1, name: 'Default webhook template' }],
49
+ subtotal: 1,
50
+ page: 1,
51
+ per_page: 20,
52
+ },
53
+ };
54
+
55
+ const webhookEventsApiResponse = {
56
+ data: ['host_created', 'host_updated'],
57
+ };
58
+
59
+ const mockIndexApiGet = () => {
60
+ API.get.mockImplementation(url => {
61
+ const path = typeof url === 'string' ? url : '';
62
+
63
+ if (path.includes('/events')) {
64
+ return Promise.resolve(webhookEventsApiResponse);
65
+ }
66
+
67
+ if (path.includes('webhook_templates')) {
68
+ return Promise.resolve(webhookTemplatesApiResponse);
69
+ }
70
+
71
+ if (path.includes(WEBHOOKS_API_PLAIN_PATH) && !path.includes('/events')) {
72
+ return Promise.resolve(webhooksApiResponse);
73
+ }
74
+
75
+ return Promise.resolve({ data: { results: [], total: 0, subtotal: 0 } });
76
+ });
77
+ };
78
+
79
+ const renderPage = () =>
80
+ renderWithStoreAndI18n(
81
+ <MemoryRouter initialEntries={['/webhooks']}>
82
+ <WebhooksIndexPage />
83
+ </MemoryRouter>
84
+ );
85
+
86
+ describe('WebhooksIndexPage integration', () => {
87
+ beforeEach(() => {
88
+ mockIndexApiGet();
89
+ });
90
+
91
+ afterEach(() => {
92
+ jest.clearAllMocks();
93
+ });
94
+
95
+ it('renders the webhooks table after the index API loads', async () => {
96
+ renderPage();
97
+
98
+ expect(
99
+ await screen.findByRole('heading', { name: 'Webhooks' })
100
+ ).toBeInTheDocument();
101
+ expect(await screen.findByRole('grid')).toBeInTheDocument();
102
+ expect(screen.getByRole('columnheader', { name: 'Name' })).toBeInTheDocument();
103
+ expect(
104
+ screen.getByRole('columnheader', { name: 'Target URL' })
105
+ ).toBeInTheDocument();
106
+ expect(await screen.findByText('my-webhook')).toBeInTheDocument();
107
+ expect(screen.getByText('your-webhook')).toBeInTheDocument();
108
+ expect(API.get).toHaveBeenCalledWith(
109
+ expect.stringContaining(WEBHOOKS_API_PLAIN_PATH),
110
+ expect.anything(),
111
+ expect.anything()
27
112
  );
113
+ });
114
+
115
+ it('opens the create webhook modal from the toolbar', async () => {
116
+ renderPage();
117
+
118
+ await screen.findByText('my-webhook');
119
+
120
+ expect(
121
+ screen.queryByRole('dialog', { name: 'Create Webhook' })
122
+ ).not.toBeInTheDocument();
28
123
 
29
- const component = integrationTestHelper.mount(
30
- <Router history={history}>
31
- <ConnectedWebhooksIndexPage history={history} />
32
- </Router>
124
+ await userEvent.click(
125
+ await screen.findByRole('button', { name: 'Create new' })
33
126
  );
34
127
 
35
- expect(component.find('table[role="grid"]').exists()).toEqual(true);
36
- expect(component.exists('WebhookCreateModal')).toEqual(true);
128
+ expect(
129
+ screen.getByRole('dialog', { name: 'Create Webhook' })
130
+ ).toBeInTheDocument();
37
131
  });
38
132
  });
@@ -1,4 +1,4 @@
1
- import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
1
+ import { STATUS } from 'foremanReact/constants';
2
2
 
3
3
  import {
4
4
  selectWebhooks,
@@ -11,6 +11,7 @@ import {
11
11
  selectIsLoading,
12
12
  selectSubtotal,
13
13
  selectMessage,
14
+ selectCanCreate,
14
15
  } from '../WebhooksPageSelectors';
15
16
 
16
17
  import {
@@ -18,28 +19,132 @@ import {
18
19
  webhooks,
19
20
  } from '../WebhooksIndexPage/__tests__/WebhooksIndexPage.fixtures';
20
21
 
21
- const state = stateFactory({
22
+ const populatedState = stateFactory({
22
23
  results: webhooks,
23
24
  sort: { by: 'name', order: 'DESC' },
24
25
  page: 1,
25
26
  perPage: 1,
26
27
  search: 'name ~ foo',
27
28
  subtotal: 42,
28
- message: { type: 'error', text: 'This is error' },
29
+ canCreate: true,
30
+ message: { type: 'info', text: 'Saved successfully' },
29
31
  });
30
32
 
31
- const fixtures = {
32
- 'should return webhooks': () => selectWebhooks(state),
33
- 'should return page': () => selectPage(state),
34
- 'should return perPage': () => selectPerPage(state),
35
- 'should return search': () => selectSearch(state),
36
- 'should return sort': () => selectSort(state),
37
- 'should return hasData': () => selectHasData(state),
38
- 'should return hasError': () => selectHasError(state),
39
- 'should return isLoading': () => selectIsLoading(state),
40
- 'should return subtotal': () => selectSubtotal(state),
41
- 'should return message': () => selectMessage(state),
33
+ const resolvedState = stateFactory(
34
+ { results: webhooks, subtotal: webhooks.length },
35
+ { status: STATUS.RESOLVED }
36
+ );
37
+
38
+ const pendingState = stateFactory({ results: [] }, { status: STATUS.PENDING });
39
+
40
+ const errorState = {
41
+ API: {
42
+ webhooks: {
43
+ status: STATUS.ERROR,
44
+ response: {
45
+ message: 'Request failed with status code 500',
46
+ response: {
47
+ data: { error: { message: 'Unable to load webhooks' } },
48
+ },
49
+ },
50
+ },
51
+ },
42
52
  };
43
53
 
44
- describe('WebhooksPage selectors', () =>
45
- testSelectorsSnapshotWithFixtures(fixtures));
54
+ describe('WebhooksPage selectors', () => {
55
+ it('returns webhooks from the API response', () => {
56
+ expect(selectWebhooks(populatedState)).toEqual(webhooks);
57
+ });
58
+
59
+ it('returns page from the API response', () => {
60
+ expect(selectPage(populatedState)).toBe(1);
61
+ });
62
+
63
+ it('returns perPage from the API response', () => {
64
+ expect(selectPerPage(populatedState)).toBe(1);
65
+ });
66
+
67
+ it('returns search from the API response', () => {
68
+ expect(selectSearch(populatedState)).toBe('name ~ foo');
69
+ });
70
+
71
+ it('returns sort with camelCased column name', () => {
72
+ expect(selectSort(populatedState)).toEqual({ by: 'name', order: 'DESC' });
73
+ });
74
+
75
+ it('camelCases snake_case sort column names', () => {
76
+ const state = stateFactory({
77
+ sort: { by: 'target_url', order: 'ASC' },
78
+ });
79
+
80
+ expect(selectSort(state)).toEqual({ by: 'targetUrl', order: 'ASC' });
81
+ });
82
+
83
+ it('returns hasData as false when the API request is not resolved', () => {
84
+ expect(selectHasData(populatedState)).toBe(false);
85
+ });
86
+
87
+ it('returns hasData as true when the API request is resolved with results', () => {
88
+ expect(selectHasData(resolvedState)).toBe(true);
89
+ });
90
+
91
+ it('returns hasError as false for a successful API response', () => {
92
+ expect(selectHasError(populatedState)).toBe(false);
93
+ });
94
+
95
+ it('returns hasError as true when the API request failed', () => {
96
+ expect(selectHasError(errorState)).toBe(true);
97
+ });
98
+
99
+ it('returns isLoading as true when the API status is missing or pending', () => {
100
+ expect(selectIsLoading(populatedState)).toBe(true);
101
+ expect(selectIsLoading(pendingState)).toBe(true);
102
+ });
103
+
104
+ it('returns isLoading as false when the API request is resolved', () => {
105
+ expect(selectIsLoading(resolvedState)).toBe(false);
106
+ });
107
+
108
+ it('returns subtotal from the API response', () => {
109
+ expect(selectSubtotal(populatedState)).toBe(42);
110
+ });
111
+
112
+ it('returns message from the API response when there is no error', () => {
113
+ expect(selectMessage(populatedState)).toEqual({
114
+ type: 'info',
115
+ text: 'Saved successfully',
116
+ });
117
+ });
118
+
119
+ it('returns an error message from the API when the request failed', () => {
120
+ expect(selectMessage(errorState)).toEqual({
121
+ type: 'error',
122
+ text: 'Unable to load webhooks',
123
+ });
124
+ });
125
+
126
+ it('returns an empty webhook list when the API request failed', () => {
127
+ expect(selectWebhooks(errorState)).toEqual([]);
128
+ });
129
+
130
+ it('returns canCreate from the API response', () => {
131
+ expect(selectCanCreate(populatedState)).toBe(true);
132
+ });
133
+
134
+ it('returns default pagination values when the API response is empty', () => {
135
+ const emptyState = {
136
+ API: {
137
+ webhooks: {
138
+ status: STATUS.RESOLVED,
139
+ response: {},
140
+ },
141
+ },
142
+ };
143
+
144
+ expect(selectPage(emptyState)).toBe(1);
145
+ expect(selectPerPage(emptyState)).toBe(20);
146
+ expect(selectWebhooks(emptyState)).toEqual([]);
147
+ expect(selectSubtotal(emptyState)).toBe(0);
148
+ expect(selectCanCreate(emptyState)).toBe(false);
149
+ });
150
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
@@ -168,7 +168,6 @@ files:
168
168
  - webpack/ForemanWebhooks/Routes/Webhooks/WebhooksPageSelectors.js
169
169
  - webpack/ForemanWebhooks/Routes/Webhooks/__tests__/WebhooksPageHelpers.test.js
170
170
  - webpack/ForemanWebhooks/Routes/Webhooks/__tests__/WebhooksPageSelectors.test.js
171
- - webpack/ForemanWebhooks/Routes/Webhooks/__tests__/__snapshots__/WebhooksPageSelectors.test.js.snap
172
171
  - webpack/ForemanWebhooks/Routes/Webhooks/constants.js
173
172
  - webpack/index.js
174
173
  - webpack/routes_index.js
@@ -195,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
194
  - !ruby/object:Gem::Version
196
195
  version: '0'
197
196
  requirements: []
198
- rubygems_version: 4.0.10
197
+ rubygems_version: 4.0.20
199
198
  specification_version: 4
200
199
  summary: Configure webhooks for Foreman.
201
200
  test_files:
@@ -1,50 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`WebhooksPage selectors should return hasData 1`] = `false`;
4
-
5
- exports[`WebhooksPage selectors should return hasError 1`] = `false`;
6
-
7
- exports[`WebhooksPage selectors should return isLoading 1`] = `true`;
8
-
9
- exports[`WebhooksPage selectors should return message 1`] = `
10
- Object {
11
- "text": "This is error",
12
- "type": "error",
13
- }
14
- `;
15
-
16
- exports[`WebhooksPage selectors should return page 1`] = `1`;
17
-
18
- exports[`WebhooksPage selectors should return perPage 1`] = `1`;
19
-
20
- exports[`WebhooksPage selectors should return search 1`] = `"name ~ foo"`;
21
-
22
- exports[`WebhooksPage selectors should return sort 1`] = `
23
- Object {
24
- "by": "name",
25
- "order": "DESC",
26
- }
27
- `;
28
-
29
- exports[`WebhooksPage selectors should return subtotal 1`] = `42`;
30
-
31
- exports[`WebhooksPage selectors should return webhooks 1`] = `
32
- Array [
33
- Object {
34
- "canDelete": true,
35
- "canEdit": true,
36
- "enabled": true,
37
- "id": 1,
38
- "name": "my-webhook",
39
- "targetUrl": "https://my-machine.example.com",
40
- },
41
- Object {
42
- "canDelete": false,
43
- "canEdit": false,
44
- "enabled": false,
45
- "id": 2,
46
- "name": "your-webhook",
47
- "targetUrl": "https://your-machine.example.com",
48
- },
49
- ]
50
- `;