Skip to content

Commit d8a62a6

Browse files
committed
test: Fix frontend and backend unit tests #1675
1 parent fae03ab commit d8a62a6

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

backend/src/test/java/ch/puzzle/okr/service/validation/EvaluationViewValidationServiceTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class EvaluationViewValidationServiceTest {
2626
void shouldCallProperMethodsToValidateOnGet() {
2727
TeamQuarterFilter ids = new TeamQuarterFilter(List.of(1L, 2L), 1L);
2828
evaluationViewValidationService.validateOnGet(ids);
29-
verify(teamValidationService, times(2)).validateOnGet(any());
3029
verify(quarterValidationService, times(1)).validateOnGet(any());
3130
}
3231
}

frontend/src/app/statistics/statistics-information/statistics-information.component.spec.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ describe('StatisticsInformationComponent', () => {
3333
[0,
3434
50,
3535
'0px'],
36-
[10,
36+
[0.5,
3737
50,
38-
'1000px'], // 10 * 100 = 1000px
38+
'25px'], // 0.5 * 50 = 25px
3939
[1,
4040
50,
41-
'100px'], // 1 * 100 = 100px
42-
[25,
41+
'50px'], // 1 * 50 = 50px
42+
[0.75,
4343
50,
44-
'2500px'], // 25 * 100 = 2500px
45-
[10,
46-
100,
47-
'1000px'], // 10 * 100 = 1000px (maxHeightInPx doesn't affect the result)
48-
[5,
44+
'37.5px'], // 0.75 * 50 = 37.5px
45+
[0.5,
4946
20,
50-
'500px'] // 5 * 100 = 500px
47+
'10px'] // 0.5 * 20 = 10px
5148
])('with chartValue %i and maxHeightInPx %i, should return %s', (chartValue, maxHeightInPx, expectedHeight) => {
5249
component.chartValue = chartValue;
5350
component.maxHeightInPx = maxHeightInPx;

frontend/src/app/statistics/statistics-information/statistics-information.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class StatisticsInformationComponent {
2020
@Input() maxHeightInPx = 50;
2121

2222
get chartHeight(): string {
23+
// Chart value is already a percentage. We can expect it to never be higher than 1.
2324
const heightInPx = this.chartValue * this.maxHeightInPx;
2425
return heightInPx + 'px';
2526
}

0 commit comments

Comments
 (0)