mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 07:46:24 +00:00
fix core
test and add to build pipeline
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
1aa708d0b9
commit
ea13fba732
@ -6,6 +6,7 @@
|
|||||||
"license": "EPL-2.0",
|
"license": "EPL-2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "heft build",
|
"build": "heft build",
|
||||||
|
"test": "heft test",
|
||||||
"lint:fix": "eslint --fix src"
|
"lint:fix": "eslint --fix src"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -16,7 +17,8 @@
|
|||||||
"eslint-plugin-promise":"4",
|
"eslint-plugin-promise":"4",
|
||||||
"eslint-plugin-node":"11",
|
"eslint-plugin-node":"11",
|
||||||
"eslint":"^7.32.0",
|
"eslint":"^7.32.0",
|
||||||
"simplytyped": "^3.3.0"
|
"simplytyped": "^3.3.0",
|
||||||
|
"@rushstack/heft": "^0.35.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anticrm/platform": "~0.6.5"
|
"@anticrm/platform": "~0.6.5"
|
||||||
|
@ -41,6 +41,27 @@ describe('memdb', () => {
|
|||||||
expect(result.length).toBe(txes.filter((tx) => tx._class === core.class.TxCreateDoc).length)
|
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 () => {
|
it('should query model', async () => {
|
||||||
const { model } = await createModel()
|
const { model } = await createModel()
|
||||||
const result = await model.findAll(core.class.Class, {})
|
const result = await model.findAll(core.class.Class, {})
|
||||||
|
@ -74,8 +74,9 @@ class ClientImpl implements Client {
|
|||||||
if (tx.objectSpace === core.space.Model) {
|
if (tx.objectSpace === core.space.Model) {
|
||||||
this.hierarchy.tx(tx)
|
this.hierarchy.tx(tx)
|
||||||
await this.model.tx(tx)
|
await this.model.tx(tx)
|
||||||
}
|
} else {
|
||||||
await this.conn.tx(tx)
|
await this.conn.tx(tx)
|
||||||
|
}
|
||||||
this.notify?.(tx)
|
this.notify?.(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user