Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
refactor: TT-477 based on scastillo-jp comments
Includes fix of a typo
  • Loading branch information
Davcg5 committed Jan 3, 2022
commit 4df5fecdf4b27c54e343ed6b06c876ad120e069f
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ describe('CustomerTableListComponent', () => {
});


it('changeStatus should set inactive whan active', () => {

it('changeStatus should set inactive when active', () => {
component.changeStatus();
expect(component.statusToEdit === 'inactive');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,18 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
this.openModal(item);
} else {
this.showModal = false;

this.store.dispatch(new UnarchiveCustomer(item.id, this.changeOppositeStatus(item.key)));
}
}

setActive(status: any): string {
return status === 'inactive' ? 'inactive' : 'active';
}
changeOppositeStatus(status: string): string{
changeOppositeStatus(status: string): string {
return status === 'inactive' ? 'active' : 'inactive';

}

changeStatus(): void{
changeStatus(): void {
this.store.dispatch(new UnarchiveCustomer(this.idToDelete, this.changeOppositeStatus(this.statusToEdit)));
}

Expand Down