Permalink
Browse files

fix(tests): fix tests

  • Loading branch information...
jkuri committed Aug 8, 2017
1 parent 547203b commit 866d9594903d49fa859e1fbf9d1e04cbe80052ff

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -85,7 +85,7 @@ <h1>Dashboard</h1>
</span>
</div>
</div>
<div layout-align="center" *ngIf="builds.length === show" align="center">
<div layout-align="center" *ngIf="builds.length" align="center" class="more-button-container">
<button class="button" (click)="showPreviousBuilds($event)">Show Previous Builds</button>
</div>
</div>
@@ -28,7 +28,6 @@ export class AppBuildsComponent implements OnInit, OnDestroy {

ngOnInit() {
this.fetch();
this.offset = this.show;

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

if (event.data === 'jobAdded') {
this.show = 5;
this.offset = 0;
this.fetch();
}

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

fetch(): void {
this.apiService.getBuilds(this.show, this.offset).subscribe(builds => {
this.builds = builds;
this.updateJobs();
setInterval(() => this.updateJobs(), 1000);
this.loading = false;
this.offset = this.show;
});
}

fetchAndConcat(): void {
this.apiService.getBuilds(this.show, this.offset).subscribe(builds => {
this.builds = this.builds.concat(builds);
this.updateJobs();
@@ -158,7 +169,7 @@ export class AppBuildsComponent implements OnInit, OnDestroy {
showPreviousBuilds(e: MouseEvent) {
e.preventDefault();
e.stopPropagation();
this.fetch();
this.fetchAndConcat();
this.show = this.show * 2;
this.offset = this.show;
}
@@ -77,7 +77,7 @@ export class AppTerminalComponent implements OnInit {
});
}, this.commands);
} else {
this.commands[this.commands.length - 1].output += output.trim();
this.commands[this.commands.length - 1].output += output;
}

this.commands = this.commands.map((cmd, i) => {
@@ -257,3 +257,6 @@
height: 16px
right: 10px
top: 11px

.more-button-container
margin: 20px 0
@@ -28,14 +28,15 @@
.command-line
display: flex
align-items: center
background: #282a36
background: #1F2326
margin: 2px 5px
padding: 1px 5px
border-radius: 10px
padding: 0px
border-radius: 2px
cursor: pointer
line-height: 10px

.icon
margin-top: 8px
margin-top: 6px

img
width: 24px

0 comments on commit 866d959

Please sign in to comment.