Skip to content

Commit 4df5fec

Browse files
committed
refactor: TT-477 based on scastillo-jp comments
Includes fix of a typo
1 parent 1215f18 commit 4df5fec

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ describe('CustomerTableListComponent', () => {
278278
});
279279

280280

281-
it('changeStatus should set inactive whan active', () => {
282-
281+
it('changeStatus should set inactive when active', () => {
283282
component.changeStatus();
284283
expect(component.statusToEdit === 'inactive');
285284
});

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,18 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
182182
this.openModal(item);
183183
} else {
184184
this.showModal = false;
185-
186185
this.store.dispatch(new UnarchiveCustomer(item.id, this.changeOppositeStatus(item.key)));
187186
}
188187
}
189188

190189
setActive(status: any): string {
191190
return status === 'inactive' ? 'inactive' : 'active';
192191
}
193-
changeOppositeStatus(status: string): string{
192+
changeOppositeStatus(status: string): string {
194193
return status === 'inactive' ? 'active' : 'inactive';
195-
196194
}
197195

198-
changeStatus(): void{
196+
changeStatus(): void {
199197
this.store.dispatch(new UnarchiveCustomer(this.idToDelete, this.changeOppositeStatus(this.statusToEdit)));
200198
}
201199

0 commit comments

Comments
 (0)