
This moves resolving of the config from the pattern constructor to the init() method. The idea is that adding a part to a pattern is exactly the same as adding a part to a design. In other words, late-stage adding of parts would be no different as the config gets resolved after that. This is currently broken in many different ways, but the unit tests particular to this new way of resolving the config do pass.
22 lines
456 B
JavaScript
22 lines
456 B
JavaScript
import chai from 'chai'
|
|
import { Pattern } from '../src/index.mjs'
|
|
|
|
const expect = chai.expect
|
|
|
|
describe('Hooks', () => {
|
|
it('Should contain all hooks', () => {
|
|
const pattern = new Pattern()
|
|
const h = pattern.hooks
|
|
const test = {
|
|
preDraft: [],
|
|
postDraft: [],
|
|
postLayout: [],
|
|
preSample: [],
|
|
postSample: [],
|
|
preRender: [],
|
|
postRender: [],
|
|
insertText: [],
|
|
}
|
|
expect(h).to.eql(test)
|
|
})
|
|
})
|