fix core test and add to build pipeline

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-12 10:44:31 +02:00
parent 1aa708d0b9
commit ea13fba732
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
3 changed files with 26 additions and 2 deletions

View File

@ -6,6 +6,7 @@
"license": "EPL-2.0",
"scripts": {
"build": "heft build",
"test": "heft test",
"lint:fix": "eslint --fix src"
},
"devDependencies": {
@ -16,7 +17,8 @@
"eslint-plugin-promise":"4",
"eslint-plugin-node":"11",
"eslint":"^7.32.0",
"simplytyped": "^3.3.0"
"simplytyped": "^3.3.0",
"@rushstack/heft": "^0.35.0"
},
"dependencies": {
"@anticrm/platform": "~0.6.5"

View File

@ -41,6 +41,27 @@ describe('memdb', () => {
expect(result.length).toBe(txes.filter((tx) => tx._class === core.class.TxCreateDoc).length)
})
it('should create space', async () => {
const { model } = await createModel()
const client = new TxOperations(model, core.account.System)
const result = await client.findAll(core.class.Space, {})
expect(result).toHaveLength(2)
await client.createDoc(core.class.Space, core.space.Model, {
private: false,
name: 'NewSpace',
description: '',
members: []
})
const result2 = await client.findAll(core.class.Space, {})
expect(result2).toHaveLength(3)
await client.createDoc(core.class.Space, core.space.Model, { private: false, name: 'NewSpace', description: '', members: [] })
const result3 = await client.findAll(core.class.Space, {})
expect(result3).toHaveLength(4)
})
it('should query model', async () => {
const { model } = await createModel()
const result = await model.findAll(core.class.Class, {})

View File

@ -74,8 +74,9 @@ class ClientImpl implements Client {
if (tx.objectSpace === core.space.Model) {
this.hierarchy.tx(tx)
await this.model.tx(tx)
} else {
await this.conn.tx(tx)
}
await this.conn.tx(tx)
this.notify?.(tx)
}