Skip to content

Commit 64ad0b6

Browse files
committed
newTestRun renamed into testRunCreated
1 parent 914818d commit 64ad0b6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/shared/events/events.gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class EventsGateway {
2020
this.server.emit('build_updated', build);
2121
}
2222

23-
newTestRun(testRun: TestRun): void {
23+
testRunCreated(testRun: TestRun): void {
2424
this.server.emit('testRun_created', testRun);
2525
}
2626

src/test-runs/test-runs.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const initService = async ({
2828
getImageMock = jest.fn(),
2929
saveImageMock = jest.fn(),
3030
deleteImageMock = jest.fn(),
31-
eventNewTestRunMock = jest.fn(),
31+
eventTestRunCreatedMock = jest.fn(),
3232
eventTestRunDeletedMock = jest.fn(),
3333
eventBuildUpdatedMock = jest.fn(),
3434
eventBuildCreatedMock = jest.fn(),
@@ -80,7 +80,7 @@ const initService = async ({
8080
{
8181
provide: EventsGateway,
8282
useValue: {
83-
newTestRun: eventNewTestRunMock,
83+
testRunCreated: eventTestRunCreatedMock,
8484
testRunDeleted: eventTestRunDeletedMock,
8585
buildUpdated: eventBuildUpdatedMock,
8686
buildCreated: eventBuildCreatedMock,
@@ -470,8 +470,8 @@ describe('TestRunsService', () => {
470470
const image = 'image';
471471
const baseline = 'baseline';
472472
const getImageMock = jest.fn().mockReturnValueOnce(baseline).mockReturnValueOnce(image);
473-
const eventNewTestRunMock = jest.fn();
474-
service = await initService({ testRunCreateMock, saveImageMock, getImageMock, eventNewTestRunMock });
473+
const eventTestRunCreatedMock = jest.fn();
474+
service = await initService({ testRunCreateMock, saveImageMock, getImageMock, eventTestRunCreatedMock });
475475
const diffResult: DiffResult = {
476476
status: TestStatus.unresolved,
477477
diffName: 'diff image name',
@@ -525,7 +525,7 @@ describe('TestRunsService', () => {
525525
});
526526
expect(getDiffMock).toHaveBeenCalledWith(baseline, image, testRun.diffTollerancePercent, testRun.ignoreAreas);
527527
expect(saveDiffResultMock).toHaveBeenCalledWith(testRun.id, diffResult);
528-
expect(eventNewTestRunMock).toHaveBeenCalledWith(testRunWithResult);
528+
expect(eventTestRunCreatedMock).toHaveBeenCalledWith(testRunWithResult);
529529
expect(result).toBe(testRunWithResult);
530530
});
531531

src/test-runs/test-runs.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class TestRunsService {
230230
const diffResult = this.getDiff(baseline, image, testRun.diffTollerancePercent, testVariation.ignoreAreas);
231231

232232
const testRunWithResult = await this.saveDiffResult(testRun.id, diffResult);
233-
this.eventsGateway.newTestRun(testRunWithResult);
233+
this.eventsGateway.testRunCreated(testRunWithResult);
234234
return testRunWithResult;
235235
}
236236

0 commit comments

Comments
 (0)