mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
add search for undefined _id test
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
1a1639108b
commit
bc5f551fc5
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
|
||||||
import type { Class, Doc, Obj, Ref } from '../classes'
|
import type { Class, Obj, Ref } from '../classes'
|
||||||
import core from '../component'
|
import core from '../component'
|
||||||
import { Hierarchy } from '../hierarchy'
|
import { Hierarchy } from '../hierarchy'
|
||||||
import { ModelDb, TxDb } from '../memdb'
|
import { ModelDb, TxDb } from '../memdb'
|
||||||
@ -39,9 +39,9 @@ describe('memdb', () => {
|
|||||||
const model = new ModelDb(hierarchy)
|
const model = new ModelDb(hierarchy)
|
||||||
for (const tx of txes) await model.tx(tx)
|
for (const tx of txes) await model.tx(tx)
|
||||||
const result = await model.findAll(core.class.Class, {})
|
const result = await model.findAll(core.class.Class, {})
|
||||||
expect(result.length).toBeGreaterThan(5)
|
expect(result.length).toBe(9)
|
||||||
const result2 = await model.findAll('class:workbench.Application' as Ref<Class<Doc>>, { _id: undefined })
|
const result2 = await model.findAll(core.class.Class, { _id: undefined })
|
||||||
expect(result2).toHaveLength(0)
|
expect(result2.length).toBe(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should allow delete', async () => {
|
it('should allow delete', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user