Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ describe('DataTableSummaryRowComponent', () => {
});
});

describe('Checkbox', () => {
it('should not render checkbox in summary row even if a column is checkboxable', async () => {
const checkboxableColumns = toInternalColumn([
{ prop: 'col1', checkboxable: true },
{ prop: 'col2' }
]);
componentRef.setInput('columns', checkboxableColumns);
componentRef.setInput('rows', rows);

expect(await harness.hasSummaryRow()).toBe(true);
expect(await harness.getCheckboxCount()).toBe(0);
});
});

describe('Computing', () => {
beforeEach(() => {
componentRef.setInput('columns', columns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class DataTableSummaryRowComponent {
protected readonly _internalColumns = computed(() => {
return this.columns().map(col => ({
...col,
checkboxable: false,
cellTemplate: col.summaryTemplate
}));
Comment thread
chintankavathia marked this conversation as resolved.
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export class SummaryHarness extends ComponentHarness {

private summaryRowCells = this.locatorForAll('datatable-body-cell');
private summaryRow = this.locatorForOptional('datatable-body-row');
private checkboxes = this.locatorForAll('input[type="checkbox"]');

async getSummaryRowCellText(index: number): Promise<string> {
const cells = await this.summaryRowCells();
Expand All @@ -15,4 +16,9 @@ export class SummaryHarness extends ComponentHarness {
const row = await this.summaryRow();
return !!row;
}

async getCheckboxCount(): Promise<number> {
const checkboxes = await this.checkboxes();
return checkboxes.length;
}
}
Loading