diff --git a/src/components/inventoryCard/__tests__/__snapshots__/inventoryCardContext.test.js.snap b/src/components/inventoryCard/__tests__/__snapshots__/inventoryCardContext.test.js.snap index 2b116eaee..1d9c1cabf 100644 --- a/src/components/inventoryCard/__tests__/__snapshots__/inventoryCardContext.test.js.snap +++ b/src/components/inventoryCard/__tests__/__snapshots__/inventoryCardContext.test.js.snap @@ -1,5 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`InventoryCardContext should expect specific sort properties: sort properties 1`] = ` +Object { + "CORES": "Cores", + "CORE_SECONDS": "Core-seconds", + "INSTANCE_HOURS": "Instance-hours", + "LAST_SEEN": "last_seen", + "NAME": "display_name", + "SOCKETS": "Sockets", + "STORAGE_GIBIBYTES": "Storage-gibibytes", + "TRANSFER_GIBIBYTES": "Transfer-gibibytes", +} +`; + exports[`InventoryCardContext should handle an onColumnSort event: onColumnSort event, dispatch 1`] = ` Array [ Array [ diff --git a/src/components/inventoryCard/__tests__/inventoryCardContext.test.js b/src/components/inventoryCard/__tests__/inventoryCardContext.test.js index 5ce26fddb..beb3aa8d1 100644 --- a/src/components/inventoryCard/__tests__/inventoryCardContext.test.js +++ b/src/components/inventoryCard/__tests__/inventoryCardContext.test.js @@ -4,13 +4,20 @@ import { useOnPageInstances, useOnColumnSortInstances } from '../inventoryCardContext'; -import { RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES } from '../../../services/rhsm/rhsmConstants'; +import { + RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES, + RHSM_API_QUERY_INVENTORY_SORT_TYPES as SORT_TYPES +} from '../../../services/rhsm/rhsmConstants'; describe('InventoryCardContext', () => { it('should return specific properties', () => { expect(context).toMatchSnapshot('specific properties'); }); + it('should expect specific sort properties', () => { + expect(SORT_TYPES).toMatchSnapshot('sort properties'); + }); + it('should handle instances inventory API responses', async () => { const { result: errorResponse } = shallowHook(() => useGetInstancesInventory({ diff --git a/src/components/inventoryCardSubscriptions/__tests__/__snapshots__/inventoryCardSubscriptionsContext.test.js.snap b/src/components/inventoryCardSubscriptions/__tests__/__snapshots__/inventoryCardSubscriptionsContext.test.js.snap index e4a8d65b1..5da8789cb 100644 --- a/src/components/inventoryCardSubscriptions/__tests__/__snapshots__/inventoryCardSubscriptionsContext.test.js.snap +++ b/src/components/inventoryCardSubscriptions/__tests__/__snapshots__/inventoryCardSubscriptionsContext.test.js.snap @@ -1,5 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`InventoryCardSubscriptionsContext should expect specific sort properties: sort properties 1`] = ` +Object { + "NEXT_EVENT_DATE": "next_event_date", + "NEXT_EVENT_TYPE": "next_event_type", + "QUANTITY": "quantity", + "SERVICE_LEVEL": "service_level", + "SKU": "sku", + "USAGE": "usage", +} +`; + exports[`InventoryCardSubscriptionsContext should handle an onColumnSort event: onColumnSort event, dispatch 1`] = ` Array [ Array [ diff --git a/src/components/inventoryCardSubscriptions/__tests__/inventoryCardSubscriptionsContext.test.js b/src/components/inventoryCardSubscriptions/__tests__/inventoryCardSubscriptionsContext.test.js index 8f9e915ea..931d07979 100644 --- a/src/components/inventoryCardSubscriptions/__tests__/inventoryCardSubscriptionsContext.test.js +++ b/src/components/inventoryCardSubscriptions/__tests__/inventoryCardSubscriptionsContext.test.js @@ -4,13 +4,20 @@ import { useOnPageSubscriptions, useOnColumnSortSubscriptions } from '../inventoryCardSubscriptionsContext'; -import { RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES } from '../../../services/rhsm/rhsmConstants'; +import { + RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES, + RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES as SORT_TYPES +} from '../../../services/rhsm/rhsmConstants'; describe('InventoryCardSubscriptionsContext', () => { it('should return specific properties', () => { expect(context).toMatchSnapshot('specific properties'); }); + it('should expect specific sort properties', () => { + expect(SORT_TYPES).toMatchSnapshot('sort properties'); + }); + it('should handle instances inventory API responses', async () => { const { result: errorResponse } = shallowHook(() => useGetSubscriptionsInventory({ diff --git a/src/components/inventoryCardSubscriptions/inventoryCardSubscriptionsContext.js b/src/components/inventoryCardSubscriptions/inventoryCardSubscriptionsContext.js index 093fe174d..d8a1888b8 100644 --- a/src/components/inventoryCardSubscriptions/inventoryCardSubscriptionsContext.js +++ b/src/components/inventoryCardSubscriptions/inventoryCardSubscriptionsContext.js @@ -5,7 +5,7 @@ import { reduxActions, reduxTypes, storeHooks } from '../../redux'; import { useProduct, useProductInventorySubscriptionsQuery } from '../productView/productViewContext'; import { RHSM_API_QUERY_INVENTORY_SORT_DIRECTION_TYPES as SORT_DIRECTION_TYPES, - RHSM_API_QUERY_INVENTORY_SORT_TYPES as SORT_TYPES, + RHSM_API_QUERY_INVENTORY_SUBSCRIPTIONS_SORT_TYPES as SORT_TYPES, RHSM_API_QUERY_SET_TYPES } from '../../services/rhsm/rhsmConstants'; import { helpers } from '../../common';