Skip to content

Commit

Permalink
fix(module:transfer): not setting the move button disable state (#8824)
Browse files Browse the repository at this point in the history
* fix(module:tabs): wrong cursor

* fix(module:transfer): not setting the move btn disable state

* fix(module:transfer): not setting the move btn disable state
  • Loading branch information
ParsaArvanehPA authored Nov 1, 2024
1 parent 29827df commit 195ad26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/transfer/transfer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export class NzTransferComponent implements OnInit, OnChanges, OnDestroy {
handleSelect(direction: TransferDirection, checked: boolean, item?: TransferItem): void {
const list = this.getCheckedData(direction);
if (list.every(i => i.disabled)) {
this.updateOperationStatus(direction, 0);
return;
}
this.updateOperationStatus(direction, list.length);
Expand Down
10 changes: 10 additions & 0 deletions components/transfer/transfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ describe('transfer', () => {
expect(instance.comp.rightDataSource.filter(w => !w.hide).length).toBe(COUNT - LEFTCOUNT + 1);
});

it('should have correct disable state on moving buttons', () => {
const transferOperationButtons: DebugElement[] = dl.queryAll(By.css('.ant-transfer-operation > button'));
const transferToRightButton: HTMLElement = transferOperationButtons[1].nativeNode;
expect((transferToRightButton as NzSafeAny)['disabled']).toEqual(true);
pageObject.checkItem('left', 0);
expect((transferToRightButton as NzSafeAny)['disabled']).toEqual(false);
pageObject.checkItem('left', 0);
expect((transferToRightButton as NzSafeAny)['disabled']).toEqual(true);
});

it('should be custom filter option', () => {
instance.nzFilterOption = (inputValue: string, item: NzSafeAny): boolean =>
item.description.indexOf(inputValue) > -1;
Expand Down

0 comments on commit 195ad26

Please sign in to comment.