Skip to content

Commit a046dc7

Browse files
committed
updated tests
1 parent 47df7ac commit a046dc7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ export class TestRunsService {
5656
}): Promise<TestRunResultDto> {
5757
const project = await this.prismaService.project.findUnique({ where: { id: createTestRequestDto.projectId } });
5858

59-
let testVariation = await this.testVariationService.find(createTestRequestDto);
59+
let testVariation = await this.testVariationService.find({
60+
...createTestRequestDto,
61+
sourceBranch: createTestRequestDto.baselineBranchName,
62+
});
6063
// creates variatioin if does not exist
6164
if (!testVariation) {
6265
testVariation = await this.testVariationService.create({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ describe('TestVariationsService', () => {
232232
// .Arrange
233233
const createRequestWithBaseline = {
234234
...createRequest,
235-
baselineBranchName: 'baseline-branch',
235+
sourceBranch: 'baseline-branch',
236236
};
237237
const variationBaselineMock: TestVariation = {
238238
...variationMock,
@@ -253,7 +253,7 @@ describe('TestVariationsService', () => {
253253
expect(projectFindUniqueMock).toHaveBeenCalledWith({ where: { id: createRequest.projectId } });
254254
expect(service.findUnique).toHaveBeenNthCalledWith(1, {
255255
...findRequestTemplate,
256-
branchName: createRequestWithBaseline.baselineBranchName,
256+
branchName: createRequestWithBaseline.sourceBranch,
257257
});
258258
expect(service.findUnique).toHaveBeenNthCalledWith(2, {
259259
...findRequestTemplate,

0 commit comments

Comments
 (0)