mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-26 22:16:28 +08:00
28 lines
891 B
CoffeeScript
28 lines
891 B
CoffeeScript
describe 'model.component', ->
|
|
Component = require '../../model/component'
|
|
|
|
describe '.createComponent', ->
|
|
it 'should success', ->
|
|
createAccount().then (account) ->
|
|
Component.createComponent account,
|
|
name: 'linux component'
|
|
type: 'linux'
|
|
node: 'master'
|
|
.then ->
|
|
Component.getComponents(account).then (components) ->
|
|
_.findWhere(components,
|
|
name: 'linux component'
|
|
).should.be.exists
|
|
|
|
describe '::hasMember', ->
|
|
it 'should success', ->
|
|
createAccount().then (account) ->
|
|
createComponent({account}).then (component) ->
|
|
component.hasMember(account).should.be.true
|
|
|
|
describe '::populate', ->
|
|
it 'should success', ->
|
|
createComponent().then (component) ->
|
|
component.populate().then ->
|
|
component.account.username.should.be.exists
|