Skip to content

Commit 3e2fb25

Browse files
committed
fix: TT-24 rename some variables
1 parent fcf718f commit 3e2fb25

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/app/modules/customer-management/components/projects/components/project-list/project-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<tr class="d-flex" *ngFor="let project of projects">
1414
<td class="col-sm-4">{{ project.id }}</td>
1515
<td class="col-sm-3">{{ project.name }}</td>
16-
<td class="col-sm-3">{{ getProjectType(project.project_type_id) }}</td>
16+
<td class="col-sm-3">{{ getProjectTypeName(project.project_type_id) }}</td>
1717
<td class="col-sm-1 text-center">
1818
<button type="button" class="btn btn-sm btn-primary" (click)="updateProject(project)">
1919
<i class="fa fa-pencil fa-xs"></i>

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,28 @@ describe('ProjectListComponent', () => {
156156
});
157157

158158
it('getProjectType should be called to display it in projects table', () => {
159-
const nameType = {
159+
const projectType = {
160160
id: '1234',
161161
name: 'BK',
162162
description: 'test',
163163
};
164164
const id = '1234';
165-
component.projectsTypes = [nameType];
165+
166+
component.projectsTypes = [projectType];
166167
component.ngOnInit();
167-
const nameTest = component.getProjectType(id);
168-
expect(nameTest).toBe('BK');
168+
169+
const projectNameTest = component.getProjectTypeName(id);
170+
expect(projectNameTest).toBe('BK');
169171
});
170172

171173
it('projects table should display Project Type', (done) => {
172-
const nameType = {
174+
const projectType = {
173175
id: '1234',
174176
name: 'BK',
175177
description: 'test',
176178
};
177-
component.projectsTypes = [nameType];
179+
180+
component.projectsTypes = [projectType];
178181
fixture.detectChanges();
179182
fixture.whenStable().then(() => {
180183
fixture.detectChanges();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export class ProjectListComponent implements OnInit, OnDestroy {
7575
}
7676
}
7777

78-
getProjectType(typeId: string) {
79-
const typeName = this.projectsTypes.find(
78+
getProjectTypeName(typeId: string) {
79+
const typeProject = this.projectsTypes.find(
8080
(prop) => prop.id === typeId
8181
);
82-
return typeName !== undefined ? typeName.name : '';
82+
return typeProject !== undefined ? typeProject.name : '';
8383
}
8484

8585
updateProject(project) {

0 commit comments

Comments
 (0)