Sha256: e6a28732b260d70b1d7e9190efcb7a37e6299f0b8121c201cc33efa88efa8c10

Contents?: true

Size: 1.23 KB

Versions: 22

Compression:

Stored size: 1.23 KB

Contents

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

import {
  selectWebhooks,
  selectPage,
  selectPerPage,
  selectSearch,
  selectSort,
  selectHasData,
  selectHasError,
  selectIsLoading,
  selectSubtotal,
  selectMessage,
} from '../WebhooksPageSelectors';

import {
  stateFactory,
  webhooks,
} from '../WebhooksIndexPage/__tests__/WebhooksIndexPage.fixtures';

const state = stateFactory({
  results: webhooks,
  sort: { by: 'name', order: 'DESC' },
  page: 1,
  perPage: 1,
  search: 'name ~ foo',
  subtotal: 42,
  message: { type: 'error', text: 'This is error' },
});

const fixtures = {
  'should return webhooks': () => selectWebhooks(state),
  'should return page': () => selectPage(state),
  'should return perPage': () => selectPerPage(state),
  'should return search': () => selectSearch(state),
  'should return sort': () => selectSort(state),
  'should return hasData': () => selectHasData(state),
  'should return hasError': () => selectHasError(state),
  'should return isLoading': () => selectIsLoading(state),
  'should return subtotal': () => selectSubtotal(state),
  'should return message': () => selectMessage(state),
};

describe('WebhooksPage selectors', () =>
  testSelectorsSnapshotWithFixtures(fixtures));

Version data entries

22 entries across 22 versions & 1 rubygems

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