Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-03-28 14:04:22 +06:00 committed by GitHub
parent 667d22cb7a
commit 78b1d38340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -229,12 +229,12 @@ export abstract class TxProcessor implements WithTx {
static createDoc2Doc<T extends Doc>(tx: TxCreateDoc<T>): T { static createDoc2Doc<T extends Doc>(tx: TxCreateDoc<T>): T {
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
return { return {
...tx.attributes,
_id: tx.objectId, _id: tx.objectId,
_class: tx.objectClass, _class: tx.objectClass,
space: tx.objectSpace, space: tx.objectSpace,
modifiedBy: tx.modifiedBy, modifiedBy: tx.modifiedBy,
modifiedOn: tx.modifiedOn, modifiedOn: tx.modifiedOn
...tx.attributes
} as T } as T
} }
@ -415,7 +415,7 @@ export class TxFactory {
objectClass, objectClass,
objectSpace, objectSpace,
mixin, mixin,
attributes: attributes attributes
} }
} }

View File

@ -386,7 +386,7 @@ describe('query', () => {
const comment = result[0] const comment = result[0]
if (comment !== undefined) { if (comment !== undefined) {
if (attempt > 0) { if (attempt > 0) {
expect((comment as WithLookup<AttachedComment>).$lookup?.space).toEqual(futureSpace) expect((comment as WithLookup<AttachedComment>).$lookup?.space?._id).toEqual(futureSpace._id)
resolve(null) resolve(null)
} else { } else {
expect((comment as WithLookup<AttachedComment>).$lookup?.space).toBeUndefined() expect((comment as WithLookup<AttachedComment>).$lookup?.space).toBeUndefined()
@ -433,7 +433,7 @@ describe('query', () => {
const comment = result[0] const comment = result[0]
if (comment !== undefined) { if (comment !== undefined) {
if (attempt > 0) { if (attempt > 0) {
expect(((comment as WithLookup<AttachedComment>).$lookup?.attachedTo as WithLookup<AttachedComment>)?.$lookup?.space).toEqual(futureSpace) expect(((comment as WithLookup<AttachedComment>).$lookup?.attachedTo as WithLookup<AttachedComment>)?.$lookup?.space?._id).toEqual(futureSpace._id)
resolve(null) resolve(null)
} else { } else {
expect(((comment as WithLookup<AttachedComment>).$lookup?.attachedTo as WithLookup<AttachedComment>)?.$lookup?.space).toBeUndefined() expect(((comment as WithLookup<AttachedComment>).$lookup?.attachedTo as WithLookup<AttachedComment>)?.$lookup?.space).toBeUndefined()