2014-08-11 16:24:08 -04:00
|
|
|
ThangComponentEditView = require('views/editor/component/ThangComponentsEditView')
|
2014-08-25 23:34:46 -04:00
|
|
|
ThangType = require 'models/ThangType'
|
2014-08-11 16:24:08 -04:00
|
|
|
|
|
|
|
responses =
|
|
|
|
'/db/level.component/A/version/0': {
|
|
|
|
system: 'System'
|
|
|
|
original: 'A'
|
2014-08-25 14:39:38 -04:00
|
|
|
version: { major: 0, minor: 0 }
|
2014-08-11 16:24:08 -04:00
|
|
|
name: 'A'
|
2014-08-25 23:34:46 -04:00
|
|
|
configSchema: {
|
|
|
|
type: 'object'
|
|
|
|
properties: {
|
|
|
|
propA: { type: 'number' }
|
|
|
|
propB: { type: 'string' }
|
|
|
|
}
|
|
|
|
}
|
2014-08-11 16:24:08 -04:00
|
|
|
}
|
|
|
|
'/db/level.component/B/version/0': {
|
|
|
|
system: 'System'
|
|
|
|
original: 'B'
|
2014-08-25 14:39:38 -04:00
|
|
|
version: { major: 0, minor: 0 }
|
2014-08-11 16:24:08 -04:00
|
|
|
name: 'B (depends on A)'
|
|
|
|
dependencies: [{original:'A', majorVersion: 0}]
|
|
|
|
}
|
|
|
|
'/db/level.component/C/version/0': {
|
|
|
|
system: 'System'
|
|
|
|
original: 'C'
|
2014-08-25 14:39:38 -04:00
|
|
|
version: { major: 0, minor: 0 }
|
2014-08-11 16:24:08 -04:00
|
|
|
name: 'C (depends on B)'
|
|
|
|
dependencies: [{original:'B', majorVersion: 0}]
|
2014-08-25 23:34:46 -04:00
|
|
|
configSchema: {
|
|
|
|
type: 'object'
|
|
|
|
default: { propC: 'Default property from component config' }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
'/db/level.component/D/version/0': {
|
|
|
|
system: 'System'
|
|
|
|
original: 'D'
|
|
|
|
version: { major: 0, minor: 0 }
|
|
|
|
name: 'D (comes from ThangType components)'
|
2014-08-11 16:24:08 -04:00
|
|
|
}
|
2014-08-25 14:39:38 -04:00
|
|
|
'/db/thang.type': []
|
2014-08-11 16:24:08 -04:00
|
|
|
|
|
|
|
module.exports = ->
|
|
|
|
view = new ThangComponentEditView({
|
|
|
|
components: [
|
|
|
|
{ original: 'B', majorVersion: 0 }
|
|
|
|
{ original: 'C', majorVersion: 0 }
|
2014-08-26 16:27:17 -04:00
|
|
|
{ original: 'A', majorVersion: 0, config: {propA: 1, propB: 'string'} }
|
2014-08-11 16:24:08 -04:00
|
|
|
]
|
2014-08-25 23:34:46 -04:00
|
|
|
thangType: new ThangType({
|
|
|
|
components: [
|
2014-08-26 12:48:33 -04:00
|
|
|
{ original: 'A', majorVersion: 0, config: {propD: 'Default property from thang type component.'} }
|
|
|
|
{ original: 'D', majorVersion: 0, config: {prop1: 'one', prop2: 'two'} }
|
2014-08-25 23:34:46 -04:00
|
|
|
]
|
|
|
|
})
|
2014-08-11 16:24:08 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
view.render()
|
|
|
|
jasmine.Ajax.requests.sendResponses(responses)
|
|
|
|
view.$el.css('background', 'white')
|
|
|
|
|
|
|
|
return view
|