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
Next Next commit
refactor: TT-477 change of name of variable
  • Loading branch information
Davcg5 committed Dec 30, 2021
commit 1215f180dd078d1711c1ab8b84aa3a5f4840c02b
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ describe('CustomerTableListComponent', () => {
it('changeStatus should set inactive whan active', () => {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this white line

component.changeStatus();
expect(component.status === 'inactive');
expect(component.statusToEdit === 'inactive');
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
showModal = false;
idToDelete: string;
idToEdit: string;
status: string;
statusToEdit: string;
currentCustomerIdToEdit: string;
message: string;
isLoading$: Observable<boolean>;
Expand Down Expand Up @@ -171,7 +171,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {

openModal(item: Customer) {
this.idToDelete = item.id;
this.status = item.status;
this.statusToEdit = item.status;
this.message = `Are you sure you want to disable ${item.name}?`;
this.showModal = true;
}
Expand All @@ -196,7 +196,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
}

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

}