fix(commits): add streamId to legacyCommitsQuery (#3512)

This commit is contained in:
Gergő Jedlicska
2024-11-19 10:46:07 +01:00
committed by GitHub
parent 4e7a00250c
commit c23da67313
2 changed files with 12 additions and 1 deletions
@@ -667,6 +667,7 @@ export const legacyGetPaginatedStreamCommitsPageFactory =
{ authorName: 'users.name' },
{ authorId: 'users.id' },
{ authorAvatar: 'users.avatar' },
{ streamId: 'stream_commits.streamId' },
knex.raw(`?? as "author"`, ['users.id'])
])
.select()
@@ -554,7 +554,15 @@ describe('Commits @core-commits', () => {
const idCommit = await getCommit(commitId3, { streamId: stream.id })
for (const commit of [userCommit, serverCommit, branchCommit, idCommit]) {
expect(userCommit).to.have.property('sourceApplication')
expect(userCommit.sourceApplication).to.be.a('string')
expect(userCommit).to.have.property('totalChildrenCount')
expect(userCommit.totalChildrenCount).to.be.a('number')
expect(userCommit).to.have.property('parents')
for (const commit of [serverCommit, branchCommit, idCommit]) {
expect(commit).to.have.property('sourceApplication')
expect(commit.sourceApplication).to.be.a('string')
@@ -562,10 +570,12 @@ describe('Commits @core-commits', () => {
expect(commit.totalChildrenCount).to.be.a('number')
expect(commit).to.have.property('parents')
expect(commit.streamId).to.equal(stream.id)
}
expect(idCommit.parents).to.be.a('array')
expect(idCommit.parents.length).to.equal(2)
expect(idCommit.streamId).to.equal(stream.id)
})
it('Should have an array of parents', async () => {