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 @@ -4,9 +4,10 @@ import { By } from "@angular/platform-browser";
import { ElectronShell } from "@batch-flask/electron";
import { ElectronTestingModule, MockElectronShell } from "@batch-flask/electron/testing";
import { PoolErrorDisplayComponent } from "app/components/pool/details";
import { Pool, ResizeErrorCode } from "app/models";
import { NameValuePair, Pool, ResizeErrorCode } from "app/models";
import { BatchAccountService, PoolService } from "app/services";
import { Constants } from "common";
import { List } from "immutable";
import { of } from "rxjs";
import * as Fixtures from "test/fixture";
import { BannerMockComponent } from "test/utils/mocks/components";
Expand Down Expand Up @@ -59,6 +60,9 @@ describe("PoolErrorDisplayComponent", () => {
resizeErrors: [{
code: ResizeErrorCode.accountCoreQuotaReached,
message: "Reached account core quota",
values: List([
new NameValuePair({name: "details", value: "Regional quota reached"})
])
}],
});
fixture.detectChanges();
Expand All @@ -68,10 +72,11 @@ describe("PoolErrorDisplayComponent", () => {
expect(fixture.debugElement.queryAll(By.css("bl-banner")).length).toBe(1);
});

it("Should show the code and message", () => {
it("Should show the code, message, and details", () => {
const banner = fixture.debugElement.query(By.css("bl-banner"));
expect(banner.nativeElement.textContent).toContain(ResizeErrorCode.accountCoreQuotaReached);
expect(banner.nativeElement.textContent).toContain("Reached account core quota");
expect(banner.nativeElement.textContent).toContain("details: Regional quota reached");
});

it("should propose increase quota as a first fix", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span title="{{resizeError.message}} ({{dedicatedQuota | async}} cores)" message>{{resizeError.message}} ({{dedicatedQuota | async}} cores)</span>
<div details *ngIf="resizeError.values.size !== 0">
<div *ngFor="let entry of resizeError.values;trackBy: trackErrorValue">
<div>{{entry.key}}: {{entry.value}}</div>
<div>{{entry.name}}: {{entry.value}}</div>
</div>
</div>
</bl-banner>
Expand All @@ -18,7 +18,7 @@
<span title="{{resizeError.message}} ({{lowPriorityQuota | async}} cores)" message>{{resizeError.message}} ({{lowPriorityQuota | async}} cores)</span>
<div details *ngIf="resizeError.values.size !== 0">
<div *ngFor="let entry of resizeError.values;trackBy: trackErrorValue">
<div>{{entry.key}}: {{entry.value}}</div>
<div>{{entry.name}}: {{entry.value}}</div>
</div>
</div>
</bl-banner>
Expand All @@ -27,7 +27,7 @@
<span title="{{resizeError.message}}" message>{{resizeError.message}}</span>
<div details *ngIf="resizeError.values.size !== 0">
<div *ngFor="let entry of resizeError.values;trackBy: trackErrorValue">
<div>{{entry.key}}: {{entry.value}}</div>
<div>{{entry.name}}: {{entry.value}}</div>
</div>
</div>
</bl-banner>
Expand Down