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
2 changes: 1 addition & 1 deletion src/crash/crash-api-client/crash-api-client.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('CrashApiClient', () => {
describe('reprocessCrash', () => {
it('should return 200 for database fred and a recent crash that has symbols', async () => {
// TODO BG https://github.com/BugSplat-Git/bugsplat-js-api-client/issues/19
const response = await client.reprocessCrash(database, 100820);
const response = await client.reprocessCrash(database, 103339);

expect(response.success).toEqual(true);
});
Expand Down
2 changes: 1 addition & 1 deletion src/events/event/create-event-from-api-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ function getInitialsOrDefault(event: any): string {
return `${firstInitial}${lastInitial}`;
}

return event.username.substring(0, 2);
return event.username?.substring(0, 2) ?? '';
}
11 changes: 11 additions & 0 deletions src/events/event/event.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,16 @@ describe('Events', () => {
jasmine.arrayContaining([expected])
);
});

it('should return empty string if username is null or undefined', () => {
const eventWithoutUsername = {
...fakeEvents[0],
username: undefined
};

const results = convertEventsToEventStreamEvents([eventWithoutUsername]);

expect(results[0].subject.initials).toEqual('');
});
});
});