Skip to content

Commit af17227

Browse files
authored
Merge pull request #245 from ivareri/display_uuid
Display uuid on task description
2 parents 23838f9 + c211030 commit af17227

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

src/app/component/task-description/task-description.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ <h1>
1010
</div>
1111

1212
<mat-accordion multi="true">
13+
<mat-expansion-panel>
14+
<mat-expansion-panel-header>
15+
<mat-panel-title>
16+
<b>UUID</b>
17+
</mat-panel-title>
18+
</mat-expansion-panel-header>
19+
<p [innerHTML]="currentTask.uuid"></p>
20+
</mat-expansion-panel>
21+
1322
<mat-expansion-panel [expanded]="true">
1423
<mat-expansion-panel-header>
1524
<mat-panel-title>

src/app/component/task-description/task-description.component.spec.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,22 @@ describe('TaskDescriptionComponent', () => {
4040
expect(heading.textContent).toContain(testSubDimension);
4141
});
4242

43+
it('check if UUID is being genenrated', () => {
44+
const testUUID = '00000000-0000-0000-0000-000000000000';
45+
component.currentTask.uuid = testUUID;
46+
fixture.detectChanges();
47+
const HTMLElement: HTMLElement = fixture.nativeElement;
48+
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
49+
expect(contentDisplayedinParagraphTag[0].textContent).toContain(testUUID);
50+
});
51+
4352
it('check if description is being genenrated', () => {
4453
const testDescription = 'Sample Description';
4554
component.currentTask.description = testDescription;
4655
fixture.detectChanges();
4756
const HTMLElement: HTMLElement = fixture.nativeElement;
4857
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
49-
expect(contentDisplayedinParagraphTag[0].textContent).toContain(
58+
expect(contentDisplayedinParagraphTag[1].textContent).toContain(
5059
testDescription
5160
);
5261
});
@@ -57,7 +66,7 @@ describe('TaskDescriptionComponent', () => {
5766
fixture.detectChanges();
5867
const HTMLElement: HTMLElement = fixture.nativeElement;
5968
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
60-
expect(contentDisplayedinParagraphTag[1].textContent).toContain(testRisk);
69+
expect(contentDisplayedinParagraphTag[2].textContent).toContain(testRisk);
6170
});
6271

6372
it('check if measure is being genenrated', () => {
@@ -66,7 +75,7 @@ describe('TaskDescriptionComponent', () => {
6675
fixture.detectChanges();
6776
const HTMLElement: HTMLElement = fixture.nativeElement;
6877
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
69-
expect(contentDisplayedinParagraphTag[2].textContent).toContain(
78+
expect(contentDisplayedinParagraphTag[3].textContent).toContain(
7079
testMeasure
7180
);
7281
});
@@ -77,7 +86,7 @@ describe('TaskDescriptionComponent', () => {
7786
fixture.detectChanges();
7887
const HTMLElement: HTMLElement = fixture.nativeElement;
7988
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
80-
expect(contentDisplayedinParagraphTag[3].textContent).toContain(
89+
expect(contentDisplayedinParagraphTag[4].textContent).toContain(
8190
testImplementationGuide
8291
);
8392
});
@@ -88,7 +97,7 @@ describe('TaskDescriptionComponent', () => {
8897
fixture.detectChanges();
8998
const HTMLElement: HTMLElement = fixture.nativeElement;
9099
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
91-
expect(contentDisplayedinParagraphTag[6].textContent).toContain(
100+
expect(contentDisplayedinParagraphTag[7].textContent).toContain(
92101
testEvidence
93102
);
94103
});
@@ -99,7 +108,7 @@ describe('TaskDescriptionComponent', () => {
99108
fixture.detectChanges();
100109
const HTMLElement: HTMLElement = fixture.nativeElement;
101110
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
102-
expect(contentDisplayedinParagraphTag[7].textContent).toContain(
111+
expect(contentDisplayedinParagraphTag[8].textContent).toContain(
103112
testAssessment
104113
);
105114
});
@@ -110,7 +119,7 @@ describe('TaskDescriptionComponent', () => {
110119
fixture.detectChanges();
111120
const HTMLElement: HTMLElement = fixture.nativeElement;
112121
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
113-
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
122+
expect(contentDisplayedinParagraphTag[11].textContent).toContain(
114123
testComments
115124
);
116125
});
@@ -125,7 +134,7 @@ describe('TaskDescriptionComponent', () => {
125134
fixture.detectChanges();
126135
const HTMLElement: HTMLElement = fixture.nativeElement;
127136
const contentDisplayedinParagraphTag = HTMLElement.querySelectorAll('p')!;
128-
expect(contentDisplayedinParagraphTag[9].textContent).toContain(
137+
expect(contentDisplayedinParagraphTag[10].textContent).toContain(
129138
component.SAMMVersion +
130139
testSAMM[0] +
131140
component.ISOVersion +

src/app/component/task-description/task-description.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface taskDescription {
1616
level: string;
1717
tags: string[];
1818
taskName: string;
19+
uuid: string;
1920
description: string;
2021
risk: string;
2122
measure: string;
@@ -47,6 +48,7 @@ export class TaskDescriptionComponent implements OnInit {
4748
level: '',
4849
tags: [''],
4950
taskName: '',
51+
uuid: '',
5052
description: '',
5153
risk: '',
5254
measure: '',
@@ -107,6 +109,7 @@ export class TaskDescriptionComponent implements OnInit {
107109
data['description'],
108110
''
109111
);
112+
this.currentTask.uuid = this.defineStringValues(data['uuid'], '');
110113
this.currentTask.risk = this.defineStringValues(data['risk'], '');
111114
this.currentTask.tags = this.defineStringArrayValues(data['tags'], []);
112115
this.currentTask.measure = this.defineStringValues(data['measure'], '');

0 commit comments

Comments
 (0)