Sha256: 41c1e953cb2e48d3a6f7e621a3df6d6e3306052bd6e347027da24d50f5b5de60

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 KB

Contents

import { testComponentSnapshotsWithFixtures } from '@theforeman/test';

import WebhookForm from '../WebhookForm';

const props = {
  handleSubmit: jest.fn(),
  onCancel: jest.fn(),
  onSuccess: jest.fn(),
  templates: [
    { id: 204, name: 'default template' },
    { id: 205, name: 'default template clone' },
  ],
  availableEvents: ['host_created'],
  isEventsLoading: false,
  isTemplatesLoading: false,
};

const fixtures = {
  'should render for new page': {
    ...props,
    initialValues: {
      http_method: 'POST',
      enabled: true,
      verify_ssl: true,
      http_content_type: 'application/json',
      event: 'host_created.event.foreman',
    },
  },
  'should render for edit page': {
    ...props,
    initialValues: {
      id: 54,
      http_method: 'PUT',
      enabled: true,
      verify_ssl: true,
      http_content_type: 'application/json',
      event: 'host_created.event.foreman',
      name: 'first webhook',
      target_url: 'https://foreman.example.com',
      user: undefined,
      password: undefined,
      webhook_template_id: 204,
      ssl_ca_certs: undefined,
    },
  },
};

describe('WebhookForm', () => {
  describe('rendering', () =>
    testComponentSnapshotsWithFixtures(WebhookForm, fixtures));
});

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_webhooks-4.0.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.2.3 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.2.2 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.1.1 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.2.1 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.2.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.1.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.5 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-2.0.3 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.4 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-2.0.2 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.3 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.2 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.1 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-2.0.1 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-3.0.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-2.0.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js
foreman_webhooks-1.1.0 webpack/ForemanWebhooks/Routes/Webhooks/Components/WebhookForm/__tests__/WebhookForm.test.js