1
0
Fork 0

wip(core): Test for part in shorthand

This commit is contained in:
joostdecock 2022-09-10 19:34:43 +02:00
parent bdd5cb562e
commit b78aa97af9

View file

@ -5,6 +5,22 @@ const expect = chai.expect
describe('Part', () => {
it('Shorthand should contain the part itself', () => {
let dp
const part = {
name: 'test',
draft: ({ part }) => {
dp = part
return part
}
}
const design = new Design({ parts: [ part ]})
const pattern = new design()
pattern.draft()
expect(typeof dp).to.equal('object')
expect(typeof dp.context).to.equal('object')
})
it('Should return a function from macroClosure', () => {
const pattern = new Pattern()
const part = pattern.__createPartWithContext()