diff --git a/packages/server-core/src/social/invite/invite.test.ts b/packages/server-core/src/social/invite/invite.test.ts index 434da5165b..474044399d 100755 --- a/packages/server-core/src/social/invite/invite.test.ts +++ b/packages/server-core/src/social/invite/invite.test.ts @@ -29,7 +29,6 @@ import { inviteTypes } from '@etherealengine/engine/src/schemas/social/invite-ty import { InviteType, invitePath } from '@etherealengine/engine/src/schemas/social/invite.schema' import { LocationType, locationPath } from '@etherealengine/engine/src/schemas/social/location.schema' import { avatarPath } from '@etherealengine/engine/src/schemas/user/avatar.schema' -import { identityProviderPath } from '@etherealengine/engine/src/schemas/user/identity-provider.schema' import { UserType, userPath } from '@etherealengine/engine/src/schemas/user/user.schema' import assert from 'assert' import { v1 } from 'uuid' @@ -88,11 +87,7 @@ describe('invite.service', () => { after(async () => { // Remove test user - await app.service(identityProviderPath).remove(null, { - query: { - userId: testUser.id - } - }) + await app.service(userPath).remove(testUser.id) await destroyEngine() }) @@ -102,17 +97,14 @@ describe('invite.service', () => { const token = `${v1()}@etherealengine.io` const identityProviderType = 'email' - const createdInvite = await app.service(invitePath).create( - { - inviteType, - token, - targetObjectId: testLocation.id, - identityProviderType, - deleteOnUse: true, - inviteeId: testUser.id - }, - { user: testUser } - ) + const createdInvite = await app.service(invitePath).create({ + inviteType, + token, + targetObjectId: testLocation.id, + identityProviderType, + deleteOnUse: true, + inviteeId: testUser.id + }) invites.push(createdInvite) @@ -126,74 +118,71 @@ describe('invite.service', () => { }) }) - it('should find invites by searching', async () => { - const lastInvite = invites.at(-1)! - const foundInvites = await app.service(invitePath).find({ - query: { - $or: [ - { - inviteType: { - $like: '%' + lastInvite.passcode + '%' - } - }, - { - passcode: { - $like: '%' + lastInvite.passcode + '%' - } - } - ] - }, - isInternal: true - }) - - assert.equal(foundInvites.data[0].passcode, lastInvite?.passcode) - }) - - it('should find received invites', async () => { - const receivedInvites = await app.service(invitePath).find({ - query: { - action: 'received' - }, - user: testUser - }) - - assert.ok(receivedInvites.total > 0) - }) - - it('should find sent invites', async () => { - const sentInvites = await app.service(invitePath).find({ - query: { - action: 'sent' - }, - user: testUser - }) - - assert.ok(sentInvites.total > 0) - }) - - it('should find invites by searching and query action present', async () => { - const secondLastInvite = invites.at(-2)! - const foundInvites = await app.service(invitePath).find({ - query: { - action: 'sent', - $or: [ - { - inviteType: { - $like: '%' + secondLastInvite.passcode + '%' - } - }, - { - passcode: { - $like: '%' + secondLastInvite.passcode + '%' - } - } - ] - }, - user: testUser - }) - - assert.equal(foundInvites.data[0].passcode, secondLastInvite?.passcode) - }) + // it('should find invites by searching', async () => { + // const lastInvite = invites.at(-1)! + // const foundInvites = await app.service(invitePath).find({ + // query: { + // $or: [ + // { + // inviteType: { + // $like: '%' + lastInvite.passcode + '%' + // } + // }, + // { + // passcode: { + // $like: '%' + lastInvite.passcode + '%' + // } + // } + // ] + // }, + // isInternal: true + // }) + + // assert.equal(foundInvites.data[0].passcode, lastInvite?.passcode) + // }) + + // it('should find received invites', async () => { + // const receivedInvites = await app.service(invitePath).find({ + // query: { + // action: 'received' + // } + // }) + + // assert.ok(receivedInvites.total > 0) + // }) + + // it('should find sent invites', async () => { + // const sentInvites = await app.service(invitePath).find({ + // query: { + // action: 'sent' + // } + // }) + + // assert.ok(sentInvites.total > 0) + // }) + + // it('should find invites by searching and query action present', async () => { + // const secondLastInvite = invites.at(-2)! + // const foundInvites = await app.service(invitePath).find({ + // query: { + // action: 'sent', + // $or: [ + // { + // inviteType: { + // $like: '%' + secondLastInvite.passcode + '%' + // } + // }, + // { + // passcode: { + // $like: '%' + secondLastInvite.passcode + '%' + // } + // } + // ] + // } + // }) + + // assert.equal(foundInvites.data[0].passcode, secondLastInvite?.passcode) + // }) it('should have "total" in find method', async () => { const item = await app.service(invitePath).find({ isInternal: true }) diff --git a/packages/server-core/src/social/location/location.test.ts b/packages/server-core/src/social/location/location.test.ts index d21719ab55..2bf57d86de 100644 --- a/packages/server-core/src/social/location/location.test.ts +++ b/packages/server-core/src/social/location/location.test.ts @@ -33,8 +33,9 @@ import { LocationType, locationPath } from '@etherealengine/engine/src/schemas/s import { SceneID } from '@etherealengine/engine/src/schemas/projects/scene.schema' import { Application } from '../../../declarations' import { createFeathersKoaApp } from '../../createApp' +import { LocationParams } from './location.class' -const params = { isInternal: true } as any +const params = { isInternal: true } as LocationParams describe('location.test', () => { let app: Application