Skip to content

Commit 866d959

Browse files
committed
fix(tests): fix tests
1 parent 547203b commit 866d959

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/app-builds/app-builds.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h1>Dashboard</h1>
8585
</span>
8686
</div>
8787
</div>
88-
<div layout-align="center" *ngIf="builds.length === show" align="center">
88+
<div layout-align="center" *ngIf="builds.length" align="center" class="more-button-container">
8989
<button class="button" (click)="showPreviousBuilds($event)">Show Previous Builds</button>
9090
</div>
9191
</div>

src/app/components/app-builds/app-builds.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
2828

2929
ngOnInit() {
3030
this.fetch();
31-
this.offset = this.show;
3231

3332
this.sub = this.socketService.outputEvents
3433
.filter(x => x.type !== 'data')
@@ -43,6 +42,8 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
4342
}
4443

4544
if (event.data === 'jobAdded') {
45+
this.show = 5;
46+
this.offset = 0;
4647
this.fetch();
4748
}
4849

@@ -83,6 +84,16 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
8384
}
8485

8586
fetch(): void {
87+
this.apiService.getBuilds(this.show, this.offset).subscribe(builds => {
88+
this.builds = builds;
89+
this.updateJobs();
90+
setInterval(() => this.updateJobs(), 1000);
91+
this.loading = false;
92+
this.offset = this.show;
93+
});
94+
}
95+
96+
fetchAndConcat(): void {
8697
this.apiService.getBuilds(this.show, this.offset).subscribe(builds => {
8798
this.builds = this.builds.concat(builds);
8899
this.updateJobs();
@@ -158,7 +169,7 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
158169
showPreviousBuilds(e: MouseEvent) {
159170
e.preventDefault();
160171
e.stopPropagation();
161-
this.fetch();
172+
this.fetchAndConcat();
162173
this.show = this.show * 2;
163174
this.offset = this.show;
164175
}

src/app/components/app-terminal/app-terminal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class AppTerminalComponent implements OnInit {
7777
});
7878
}, this.commands);
7979
} else {
80-
this.commands[this.commands.length - 1].output += output.trim();
80+
this.commands[this.commands.length - 1].output += output;
8181
}
8282

8383
this.commands = this.commands.map((cmd, i) => {

src/app/styles/content.sass

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,6 @@
257257
height: 16px
258258
right: 10px
259259
top: 11px
260+
261+
.more-button-container
262+
margin: 20px 0

src/app/styles/terminal.sass

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
.command-line
2929
display: flex
3030
align-items: center
31-
background: #282a36
31+
background: #1F2326
3232
margin: 2px 5px
33-
padding: 1px 5px
34-
border-radius: 10px
33+
padding: 0px
34+
border-radius: 2px
3535
cursor: pointer
36+
line-height: 10px
3637

3738
.icon
38-
margin-top: 8px
39+
margin-top: 6px
3940

4041
img
4142
width: 24px

0 commit comments

Comments
 (0)