From b9a95b38085011d89a92b6331688c11058a9ee8e Mon Sep 17 00:00:00 2001 From: CD Cabrera Date: Tue, 19 Jan 2021 14:29:32 -0500 Subject: [PATCH] fix(inventoryList): consistent hide, aria-hidden attributes (#555) * inventoryList, subsInventoryList, consistent hide, aria-hidden * pagination, consistent hide, aria-hidden --- .../__snapshots__/inventoryList.test.js.snap | 20 ++++++---- .../__tests__/inventoryList.test.js | 10 +++-- src/components/inventoryList/inventoryList.js | 10 ++++- .../inventorySubscriptions.test.js.snap | 40 +++++++++++-------- .../__tests__/inventorySubscriptions.test.js | 7 +++- .../inventorySubscriptions.js | 12 ++++-- .../__snapshots__/pagination.test.js.snap | 2 +- src/components/pagination/pagination.js | 1 - 8 files changed, 66 insertions(+), 36 deletions(-) diff --git a/src/components/inventoryList/__tests__/__snapshots__/inventoryList.test.js.snap b/src/components/inventoryList/__tests__/__snapshots__/inventoryList.test.js.snap index 1027e9b05..0b624a89b 100644 --- a/src/components/inventoryList/__tests__/__snapshots__/inventoryList.test.js.snap +++ b/src/components/inventoryList/__tests__/__snapshots__/inventoryList.test.js.snap @@ -226,7 +226,8 @@ exports[`InventoryList Component should handle variations in data: filtered data updateOnResize={true} > @@ -505,7 +510,8 @@ exports[`InventoryList Component should render a non-connected component: non-co updateOnResize={true} > { { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } ], + itemCount: 2, isDisabled: true }; const component = shallow(); @@ -58,7 +59,8 @@ describe('InventoryList Component', () => { listData: [ { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } - ] + ], + itemCount: 2 }; const component = shallow(); @@ -78,7 +80,8 @@ describe('InventoryList Component', () => { [RHSM_API_QUERY_TYPES.OFFSET]: 0 }, productId: 'lorem', - listData: [{ lorem: 'sit', dolor: 'amet', numberOfGuests: 1 }] + listData: [{ lorem: 'sit', dolor: 'amet', numberOfGuests: 1 }], + itemCount: 1 }; const component = shallow(); @@ -115,7 +118,8 @@ describe('InventoryList Component', () => { listData: [ { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } - ] + ], + itemCount: 2 }; const component = shallow(); diff --git a/src/components/inventoryList/inventoryList.js b/src/components/inventoryList/inventoryList.js index 7860a47bf..7f080f10e 100644 --- a/src/components/inventoryList/inventoryList.js +++ b/src/components/inventoryList/inventoryList.js @@ -222,7 +222,10 @@ class InventoryList extends React.Component { return ( - + @@ -260,7 +263,10 @@ class InventoryList extends React.Component { - + - - + + - - + + - - + + { { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } ], + itemCount: 2, isDisabled: true }; const component = shallow(); @@ -57,7 +58,8 @@ describe('InventorySubscriptions Component', () => { listData: [ { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } - ] + ], + itemCount: 2 }; const component = shallow(); @@ -80,7 +82,8 @@ describe('InventorySubscriptions Component', () => { listData: [ { lorem: 'ipsum', dolor: 'sit' }, { lorem: 'sit', dolor: 'amet' } - ] + ], + itemCount: 2 }; const component = shallow(); diff --git a/src/components/inventorySubscriptions/inventorySubscriptions.js b/src/components/inventorySubscriptions/inventorySubscriptions.js index b68e079c8..bb94b7b9b 100644 --- a/src/components/inventorySubscriptions/inventorySubscriptions.js +++ b/src/components/inventorySubscriptions/inventorySubscriptions.js @@ -200,8 +200,11 @@ class InventorySubscriptions extends React.Component { return ( - - + + - + (