Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</span></span
>

<br />This means that your device might be eligible for most networks. Final
estimation will be available in the Zip file.
<br />{{ getRiskExplanation(data.profile.risk) }} Final estimation will be
available in the Zip file.
</p>
<mat-dialog-actions align="end" class="delete-form-actions">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { TestRunService } from '../../../../services/test-run.service';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { of } from 'rxjs';
import { PROFILE_MOCK } from '../../../../mocks/profile.mock';
import { ProfileRisk } from '../../../../model/profile';

describe('SuccessDialogComponent', () => {
let component: SuccessDialogComponent;
Expand Down Expand Up @@ -67,4 +68,13 @@ describe('SuccessDialogComponent', () => {

closeSpy.calls.reset();
});

it('should return proper text for risk', () => {
expect(component.getRiskExplanation(ProfileRisk.LIMITED)).toEqual(
'This means that your device might be eligible for most networks.'
);
expect(component.getRiskExplanation(ProfileRisk.HIGH)).toEqual(
'This means that your device might be eligible only for some networks.'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ import {
} from '@angular/material/dialog';
import { MatButtonModule } from '@angular/material/button';
import { EscapableDialogComponent } from '../../../../components/escapable-dialog/escapable-dialog.component';
import { Profile, RiskResultClassName } from '../../../../model/profile';
import {
Profile,
ProfileRisk,
RiskResultClassName,
} from '../../../../model/profile';
import { TestRunService } from '../../../../services/test-run.service';
import { CommonModule } from '@angular/common';

Expand Down Expand Up @@ -52,4 +56,10 @@ export class SuccessDialogComponent extends EscapableDialogComponent {
public getRiskClass(riskResult: string): RiskResultClassName {
return this.testRunService.getRiskClass(riskResult);
}

getRiskExplanation(risk: string | undefined) {
return risk === ProfileRisk.LIMITED
? 'This means that your device might be eligible for most networks.'
: 'This means that your device might be eligible only for some networks.';
}
}