Skip to content

Commit

Permalink
add test cases + stories
Browse files Browse the repository at this point in the history
  • Loading branch information
shachiniM committed Dec 10, 2024
1 parent 16e4d10 commit 345eabf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
});
});
9 changes: 6 additions & 3 deletions storybook/stories/core/components/List/list-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 345eabf

Please sign in to comment.