Skip to content

Commit

Permalink
Merge branch 'rv-166-oxd-list-disable-select-changes' of https://gith…
Browse files Browse the repository at this point in the history
…ub.com/ShachiniMekala/oxd into rv-166-oxd-list-disable-select-changes

	changelog.md
	components/src/core/components/ListTable/__tests__/list-table.spec.ts
  • Loading branch information
shachiniM committed Dec 10, 2024
2 parents 2e972b1 + 665d4d3 commit 5e0ba99
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,32 @@ 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('');
});

it('should render checkbox cell when selectable is true and not loading', () => {
const wrapper = mount(ListTable, {
props: {
Expand Down

0 comments on commit 5e0ba99

Please sign in to comment.