From 345eabfd79da798197b0b9ffab134c2b2484dd75 Mon Sep 17 00:00:00 2001 From: shachiniM Date: Tue, 10 Dec 2024 14:34:52 +0530 Subject: [PATCH] add test cases + stories --- .../ListTable/__tests__/list-table.spec.ts | 26 +++++++++++++++++++ .../core/components/List/list-data.json | 9 ++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/components/src/core/components/ListTable/__tests__/list-table.spec.ts b/components/src/core/components/ListTable/__tests__/list-table.spec.ts index 80a08c613..9c33b1e7a 100644 --- a/components/src/core/components/ListTable/__tests__/list-table.spec.ts +++ b/components/src/core/components/ListTable/__tests__/list-table.spec.ts @@ -89,4 +89,30 @@ describe('ListTable > ListTable.vue', () => { ); expect(wrapper.findAllComponents(Skeleton).length).toEqual(6); }); + + it('when the select is disabled for all the items, check box in the header should be disabled', () => { + const DUMMY_DATA_SELECT_DISABLED = { + headers: [ + {name: 'col1', title: 'Column 1', style: {flex: 1}}, + {name: 'col2', title: 'Column 2', style: {flex: 5}}, + ], + items: [ + {col1: 'Data 1', col2: 'Data 2', isSelectDisabled: true}, + {col1: 'Data 2', col2: 'Data 2', isSelectDisabled: true}, + ], + checkedItems: [], + }; + const wrapper = mount(ListTable, { + props: { + selectable: true, + items: DUMMY_DATA_SELECT_DISABLED.items, + headers: DUMMY_DATA_SELECT_DISABLED.headers, + selected: DUMMY_DATA_SELECT_DISABLED.checkedItems, + }, + }); + const tableHeader = wrapper.find('.oxd-table-header'); + const checkbox = tableHeader.find('input[type="checkbox"]'); + + expect(checkbox.attributes('disabled')).toEqual(''); + }); }); diff --git a/storybook/stories/core/components/List/list-data.json b/storybook/stories/core/components/List/list-data.json index 7631ee4f4..51e851d47 100644 --- a/storybook/stories/core/components/List/list-data.json +++ b/storybook/stories/core/components/List/list-data.json @@ -212,12 +212,12 @@ "allowedActions": { "stageSlot": true, "downloadResumeSlot": true, - "downloadApplicationFormSlot": true, + "downloadApplicationFormSlot": true, "compareSlot": true }, "vacancy": null, "vacancyId": null, - "isSelectDisabled" : true, + "isSelectDisabled": true, "selectDisabledTooltip": "Not allowed to delete candidates who are in progress" }, { @@ -333,7 +333,10 @@ "vacancyName": "Accounts Payable Specialist", "vacancyStatus": "1" }, - "vacancyId": "1" + "vacancyId": "1", + "isSelectDisabled": true, + "selectDisabledTooltip": "Not allowed to delete candidates who are in progress", + "selectDisabledTooltipPosition": "bottom" } ], "order": {