Sha256: bc2bb7784975a325d08d5583bf878dcde63b3676e5a4b485b3ed5d17edd8f4a8

Contents?: true

Size: 1.82 KB

Versions: 42

Compression:

Stored size: 1.82 KB

Contents

import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
import { insightsStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
import { routerState, APIState, APIErrorState } from './fixtures';
import {
  selectError,
  selectHits,
  selectInsightsCloudTable,
  selectIsAllSelected,
  selectItemCount,
  selectPage,
  selectPerPage,
  selectQuery,
  selectQueryParams,
  selectSearch,
  selectSelectedIds,
  selectShowSelectAllAlert,
  selectSortBy,
  selectSortOrder,
  selectStatus,
} from '../InsightsTableSelectors';

const state = {
  ...routerState,
  ...APIState,
  ...insightsStateWrapper({
    table: {
      selectedIds: {
        '51': true,
      },
      showSelectAllAlert: true,
      isAllSelected: false,
    },
  }),
};

const fixtures = {
  'should return router query': () => selectQuery(state),
  'should return router search': () => selectSearch(state),
  'should return router page': () => selectPage(state),
  'should return router perPage': () => selectPerPage(state),
  'should return router sort by': () => selectSortBy(state),
  'should return router sort order': () => selectSortOrder(state),
  'should return queryParams': () => selectQueryParams(state),
  'should return API status': () => selectStatus(state),
  'should return API error': () => selectError({ ...state, ...APIErrorState }),
  'should return API hits': () => selectHits(state),
  'should return API item count': () => selectItemCount(state),
  'should return insights table': () => selectInsightsCloudTable(state),
  'should return insights selectedIds': () => selectSelectedIds(state),
  'should return insights isAllSelected': () => selectIsAllSelected(state),
  'should return insights showSelectAllAlert': () =>
    selectShowSelectAllAlert(state),
};

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

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
foreman_rh_cloud-8.0.49 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-8.0.48 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-8.0.47 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-8.0.46 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.45 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.46 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.45 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-7.0.46 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.44 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-7.0.45 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.44 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.43 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.42.2 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.42.1 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.43 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.42 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-6.0.42 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.41 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.39 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js
foreman_rh_cloud-5.0.38 webpack/InsightsCloudSync/Components/InsightsTable/__tests__/InsightsTableSelectors.test.js