Skip to content

Commit 9caa770

Browse files
authored
fix: add groupByCount to CrashesApiRow (#65)
Fixes #64
1 parent 889abc5 commit 9caa770

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/crashes/crashes-api-client/crashes-api-client.e2e.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ describe('CrashesApiClient', () => {
4040
expect(row?.appName).toEqual(application);
4141
expect(row?.appVersion).toEqual(version);
4242
});
43+
44+
it('should return 200 and groupByCount for grouped crashes query', async () => {
45+
const database = config.database;
46+
const pageSize = 1;
47+
const columnGroups = ['stackKey'];
48+
49+
const result = await crashesClient.getCrashes({ database, pageSize, columnGroups });
50+
51+
const row = result.rows[0];
52+
expect(result.rows).toBeTruthy();
53+
expect(result.rows.length).toEqual(pageSize);
54+
expect(row?.groupByCount).toBeGreaterThanOrEqual(1);
55+
});
4356
});
4457

4558
describe('postNotes', () => {

src/crashes/crashes-api-row/crashes-api-row.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
interface CrashData {
22
id: string;
3+
groupByCount: number;
34
stackKey: string;
45
stackId: string;
56
stackKeyId: string;
@@ -33,6 +34,7 @@ export interface CrashesApiResponseRow extends CrashData {
3334

3435
export class CrashesApiRow {
3536
public id: number;
37+
public groupByCount: number;
3638
public stackKey: string;
3739
public stackId: number;
3840
public stackKeyId: number;
@@ -57,6 +59,7 @@ export class CrashesApiRow {
5759

5860
constructor(rawApiRow: CrashesApiResponseRow) {
5961
this.id = Number(rawApiRow.id);
62+
this.groupByCount = Number(rawApiRow.groupByCount || 0);
6063
this.stackKey = rawApiRow.stackKey;
6164
this.stackKeyId = Number(rawApiRow.stackKeyId);
6265
this.stackId = Number(rawApiRow.stackId);

0 commit comments

Comments
 (0)