Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
fix(mission-runtime-createapp): increase the limit of mission and run…
Browse files Browse the repository at this point in the history
…time description truncate.
  • Loading branch information
vikram-raj authored and ia3andy committed Aug 8, 2018
1 parent 91d215a commit e859107
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ <h2 class="card-pf-title">
</div>
<div class="list-group-item-text" *ngIf="mission.description">
<span class="description" *ngIf="mission.showMore !== true">
{{mission.description | truncate: 55}}
{{mission.description | truncate: 65}}
</span>
<span *ngIf="mission.showMore">
{{mission.description}}
</span>
<span class="description-more" *ngIf="mission.description.length > 55">
<span class="description-more" *ngIf="mission.description.length > 65">
<a href="javascript:void(0)"
(click)="mission.showMore = !mission.showMore; $event.stopPropagation()">
{{(mission.showMore) ? 'Less' : 'More'}}
Expand Down Expand Up @@ -223,12 +223,12 @@ <h2 class="card-pf-title">
</div>
<div class="list-group-item-text" *ngIf="runtime.description">
<span class="description" *ngIf="!runtime.showMore">
{{runtime.description | truncate: 55}}
{{runtime.description | truncate: 65}}
</span>
<span *ngIf="runtime.showMore">
{{runtime.description}}
</span>
<span class="description-more" *ngIf="runtime.description.length > 55">
<span class="description-more" *ngIf="runtime.description.length > 65">
<a class="description-more" href="javascript:void(0)"
(click)="runtime.showMore = !runtime.showMore; $event.stopPropagation()">
{{(runtime.showMore) ? 'Less' : 'More'}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('MissionRuntimeStepComponent', () => {
}
});

it('should have the mission description truncated if the length is beyond 55 characters', fakeAsync(() => {
it('should have the mission description truncated if the length is beyond 65 characters', fakeAsync(() => {
let desc: string = 'this is a very lengthy description just to check the functionality of truncation';
component.missions[0].description = desc;
component.missions[1].description = desc;
Expand All @@ -222,11 +222,11 @@ describe('MissionRuntimeStepComponent', () => {
let missionHead = missionsSection.querySelectorAll('.list-group-item-text');
let missions = component.missions, len = missions.length;
for (let i = 0; i < len; ++ i) {
expect((<HTMLDivElement>missionHead[i].children[0]).innerText.trim()).toBe(desc.substr(0, 55) + '...');
expect((<HTMLDivElement>missionHead[i].children[0]).innerText.trim()).toBe(desc.substr(0, 65) + '...');
}
}));

it('should show "Less" if the showMore is true and description length is more then 55 characters - Missions', () => {
it('should show "Less" if the showMore is true and description length is more then 65 characters - Missions', () => {
component.missions[0]['showMore'] = true;
fixture.detectChanges();
let missionsSection = element.querySelectorAll('.card-pf-body')[0];
Expand All @@ -253,7 +253,7 @@ describe('MissionRuntimeStepComponent', () => {
}
});

it('should show "More" if the showMore is false and description length is more that 55 characters - Missions', () => {
it('should show "More" if the showMore is false and description length is more that 65 characters - Missions', () => {
fixture.detectChanges();
let missionsSection = element.querySelectorAll('.card-pf-body')[0];
let descElement = <HTMLSpanElement>missionsSection.querySelectorAll('.list-group-item-text .description')[0];
Expand Down Expand Up @@ -351,7 +351,7 @@ describe('MissionRuntimeStepComponent', () => {
}
});

it('should have the runtime description truncated if the length is beyond 55 characters', () => {
it('should have the runtime description truncated if the length is beyond 65 characters', () => {
let desc: string = 'this is a very lengthy description just to check the functionality of truncation';
component.runtimes[0].description = desc;
component.runtimes[1].description = desc;
Expand All @@ -360,11 +360,11 @@ describe('MissionRuntimeStepComponent', () => {
let runtimesHead = runtimesSection.querySelectorAll('.list-group-item-text');
let runtimes = component.runtimes, len = runtimes.length;
for (let i = 0; i < len; ++ i) {
expect((<HTMLDivElement>runtimesHead[i].children[0]).innerText.trim()).toBe(desc.substr(0, 55) + '...');
expect((<HTMLDivElement>runtimesHead[i].children[0]).innerText.trim()).toBe(desc.substr(0, 65) + '...');
}
});

it('should show "Less" if the showMore is true and description length is more that 55 characters - Runtimes', () => {
it('should show "Less" if the showMore is true and description length is more that 65 characters - Runtimes', () => {
component.runtimes[0].showMore = true;
fixture.detectChanges();
let runtimesSection = element.querySelectorAll('.card-pf-body')[1];
Expand All @@ -377,7 +377,7 @@ describe('MissionRuntimeStepComponent', () => {
}
});

it('should show "More" if the showMore is false and description length is more that 55 characters - Runtimes', () => {
it('should show "More" if the showMore is false and description length is more that 65 characters - Runtimes', () => {
fixture.detectChanges();
let runtimesSection = element.querySelectorAll('.card-pf-body')[1];
let descElement = <HTMLSpanElement>runtimesSection.querySelectorAll('.list-group-item-text .description')[0];
Expand Down

0 comments on commit e859107

Please sign in to comment.